mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 17:44:15 +02:00
fixes #13816 Modal dialog closes when dragging and releasing mouse button outside dialog
This commit is contained in:
3
dist/css/bootstrap.css
vendored
3
dist/css/bootstrap.css
vendored
@@ -5503,7 +5503,7 @@ button.close {
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1050;
|
z-index: 1040;
|
||||||
display: none;
|
display: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
@@ -5551,7 +5551,6 @@ button.close {
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1040;
|
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
}
|
}
|
||||||
.modal-backdrop.fade {
|
.modal-backdrop.fade {
|
||||||
|
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css
vendored
2
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
15
dist/js/bootstrap.js
vendored
15
dist/js/bootstrap.js
vendored
@@ -1015,14 +1015,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
|
|||||||
var doAnimate = $.support.transition && animate
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||||
.appendTo(this.$body)
|
.prependTo(this.$element)
|
||||||
|
.on('click.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])
|
: this.hide.call(this)
|
||||||
: this.hide.call(this)
|
}, this))
|
||||||
}, this))
|
|
||||||
|
|
||||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||||
|
|
||||||
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
15
js/modal.js
15
js/modal.js
@@ -166,14 +166,13 @@
|
|||||||
var doAnimate = $.support.transition && animate
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||||
.appendTo(this.$body)
|
.prependTo(this.$element)
|
||||||
|
.on('click.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])
|
: this.hide.call(this)
|
||||||
: this.hide.call(this)
|
}, this))
|
||||||
}, this))
|
|
||||||
|
|
||||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||||
|
|
||||||
|
@@ -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').click()
|
$('#modal-test .modal-backdrop').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').click()
|
$('#modal-test .modal-backdrop').click()
|
||||||
})
|
})
|
||||||
.on('hide.bs.modal', function () {
|
.on('hide.bs.modal', function () {
|
||||||
triggered += 1
|
triggered += 1
|
||||||
|
@@ -67,7 +67,6 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: @zindex-modal-background;
|
|
||||||
background-color: @modal-backdrop-bg;
|
background-color: @modal-backdrop-bg;
|
||||||
// Fade for backdrop
|
// Fade for backdrop
|
||||||
&.fade { .opacity(0); }
|
&.fade { .opacity(0); }
|
||||||
|
@@ -260,8 +260,7 @@
|
|||||||
@zindex-popover: 1060;
|
@zindex-popover: 1060;
|
||||||
@zindex-tooltip: 1070;
|
@zindex-tooltip: 1070;
|
||||||
@zindex-navbar-fixed: 1030;
|
@zindex-navbar-fixed: 1030;
|
||||||
@zindex-modal-background: 1040;
|
@zindex-modal: 1040;
|
||||||
@zindex-modal: 1050;
|
|
||||||
|
|
||||||
|
|
||||||
//== Media queries breakpoints
|
//== Media queries breakpoints
|
||||||
|
Reference in New Issue
Block a user