Remove the right backdrop.
If anybody adds a new modal in the `then()` part of the promise, without this code, all `.modal-backdrop` elements will be deleted, and further dialogs will not be modal; with this, only the current modal's backdrop will be deleted.
This commit is contained in:
parent
e9fc7353d2
commit
7f230a540e
|
@ -137,15 +137,17 @@
|
|||
dialog.modal('show');
|
||||
field.focus();
|
||||
dialog.on('click', '.btn-primary', function () {
|
||||
var backdrop = $('.modal-backdrop');
|
||||
def.resolve(field.val(), field, dialog);
|
||||
dialog.remove();
|
||||
$('.modal-backdrop').remove();
|
||||
backdrop.remove();
|
||||
});
|
||||
});
|
||||
dialog.on('hidden.bs.modal', function () {
|
||||
var backdrop = $('.modal-backdrop');
|
||||
def.reject();
|
||||
dialog.remove();
|
||||
$('.modal-backdrop').remove();
|
||||
backdrop.remove();
|
||||
});
|
||||
if (field.is('input[type="text"], select')) {
|
||||
field.keypress(function (e) {
|
||||
|
|
Loading…
Reference in New Issue