0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

Merge branch 'v4-dev' into yiq-function-update

This commit is contained in:
Gijs Boddeus 2017-10-04 16:12:21 +02:00 committed by GitHub
commit b14250f196
2 changed files with 17 additions and 1 deletions

View File

@ -113,7 +113,7 @@ const Modal = (() => {
} }
show(relatedTarget) { show(relatedTarget) {
if (this._isTransitioning) { if (this._isTransitioning || this._isShown) {
return return
} }

View File

@ -673,4 +673,20 @@ $(function () {
$toggleBtn.trigger('click') $toggleBtn.trigger('click')
setTimeout(done, 500) setTimeout(done, 500)
}) })
QUnit.test('should not try to open a modal which is already visible', function (assert) {
assert.expect(1)
var done = assert.async()
var count = 0
$('<div id="modal-test"/>').on('shown.bs.modal', function () {
count++
}).on('hidden.bs.modal', function () {
assert.strictEqual(count, 1, 'show() runs only once')
done()
})
.bootstrapModal('show')
.bootstrapModal('show')
.bootstrapModal('hide')
})
}) })