mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Revert "Use mousedown instead of click for backdrop click detection; fixes #13816"
This commit is contained in:
parent
fc1db2e74b
commit
18c0a1c977
@ -166,7 +166,7 @@
|
|||||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||||
.appendTo(this.$body)
|
.appendTo(this.$body)
|
||||||
|
|
||||||
this.$element.on('mousedown.dismiss.bs.modal', $.proxy(function (e) {
|
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
if (e.target !== e.currentTarget) return
|
if (e.target !== e.currentTarget) return
|
||||||
this.options.backdrop == 'static'
|
this.options.backdrop == 'static'
|
||||||
? this.$element[0].focus.call(this.$element[0])
|
? this.$element[0].focus.call(this.$element[0])
|
||||||
|
@ -141,7 +141,7 @@ $(function () {
|
|||||||
notEqual($('#modal-test').length, 0, 'modal insterted into dom')
|
notEqual($('#modal-test').length, 0, 'modal insterted into dom')
|
||||||
$('.contents').click()
|
$('.contents').click()
|
||||||
ok($('#modal-test').is(':visible'), 'modal visible')
|
ok($('#modal-test').is(':visible'), 'modal visible')
|
||||||
$('#modal-test').mousedown()
|
$('#modal-test').click()
|
||||||
})
|
})
|
||||||
.on('hidden.bs.modal', function () {
|
.on('hidden.bs.modal', function () {
|
||||||
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
||||||
@ -196,7 +196,7 @@ $(function () {
|
|||||||
$('<div id="modal-test"><div class="contents"/></div>')
|
$('<div id="modal-test"><div class="contents"/></div>')
|
||||||
.on('shown.bs.modal', function () {
|
.on('shown.bs.modal', function () {
|
||||||
triggered = 0
|
triggered = 0
|
||||||
$('#modal-test').mousedown()
|
$('#modal-test').click()
|
||||||
})
|
})
|
||||||
.on('hide.bs.modal', function () {
|
.on('hide.bs.modal', function () {
|
||||||
triggered += 1
|
triggered += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user