2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

backport #29516: added animation when modal backdrop is static

This commit is contained in:
Johann-S
2019-10-28 16:28:11 +02:00
committed by XhmikosR
parent 29f585365f
commit dd96b832f7
5 changed files with 121 additions and 9 deletions
+22
View File
@@ -833,4 +833,26 @@ $(function () {
})
.bootstrapModal('show')
})
QUnit.test('should not close modal when clicking outside of modal-content if backdrop = static', function (assert) {
assert.expect(1)
var done = assert.async()
var $modal = $('<div class="modal" data-backdrop="static"><div class="modal-dialog" /></div>').appendTo('#qunit-fixture')
$modal.on('shown.bs.modal', function () {
$modal.trigger('click')
setTimeout(function () {
var modal = $modal.data('bs.modal')
assert.strictEqual(modal._isShown, true)
done()
}, 10)
})
.on('hidden.bs.modal', function () {
assert.strictEqual(true, false, 'should not hide the modal')
})
.bootstrapModal({
backdrop: 'static'
})
})
})