jameskleeh / angular-confirm

Confirmation modal dialog for AngularJS
Apache License 2.0
150 stars 75 forks source link

block user to click outside the confirm modal #64

Closed alainib closed 8 years ago

alainib commented 8 years ago

Actually if the user click outside the $confirm modal it does the same thing as clicking cancel. Is there a way to force the user to click only on "ok" or "no" button and make click outside the modal do nothing ?

$modal get an option to do this backdrop: 'static' but i don't know how to use it here ( i use $confirm as service in controller )

backdrop - controls presence of a backdrop. Allowed values: true (default), false (no backdrop), 'static' - backdrop is present but modal window is not closed when clicking outside of the modal window.

For example:

$modal.open({ templateUrl: 'myModalContent.html', controller: ModalInstanceCtrl, backdrop: 'static' })

jameskleeh commented 8 years ago

You can pass it in the settings.

$confirm(data, {backdrop: 'static'}) or <button confirm-settings="{backdrop: 'static'}"...

alainib commented 8 years ago

love you. thank you it work