mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-21 18:54:30 +01:00
move call for removeBackdrop() to backdrop()
Closes #11958 by rebasing & merging it
This commit is contained in:
parent
58ab1c64c5
commit
a69bc3bc09
10
js/modal.js
10
js/modal.js
@ -145,7 +145,6 @@
|
|||||||
var that = this
|
var that = this
|
||||||
this.$element.hide()
|
this.$element.hide()
|
||||||
this.backdrop(function () {
|
this.backdrop(function () {
|
||||||
that.removeBackdrop()
|
|
||||||
that.$element.trigger('hidden.bs.modal')
|
that.$element.trigger('hidden.bs.modal')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -156,6 +155,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Modal.prototype.backdrop = function (callback) {
|
Modal.prototype.backdrop = function (callback) {
|
||||||
|
var that = this
|
||||||
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
|
||||||
if (this.isShown && this.options.backdrop) {
|
if (this.isShown && this.options.backdrop) {
|
||||||
@ -186,11 +186,15 @@
|
|||||||
} else if (!this.isShown && this.$backdrop) {
|
} else if (!this.isShown && this.$backdrop) {
|
||||||
this.$backdrop.removeClass('in')
|
this.$backdrop.removeClass('in')
|
||||||
|
|
||||||
|
var callbackRemove = function() {
|
||||||
|
that.removeBackdrop()
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
$.support.transition && this.$element.hasClass('fade') ?
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
this.$backdrop
|
this.$backdrop
|
||||||
.one($.support.transition.end, callback)
|
.one($.support.transition.end, callbackRemove)
|
||||||
.emulateTransitionEnd(150) :
|
.emulateTransitionEnd(150) :
|
||||||
callback()
|
callbackRemove()
|
||||||
|
|
||||||
} else if (callback) {
|
} else if (callback) {
|
||||||
callback()
|
callback()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user