aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Lindig <[email protected]>2013-12-20 18:37:47 +0100
committerChris Rebert <[email protected]>2014-04-20 14:47:32 -0700
commita69bc3bc095de588ae78b663f73395134ad6ee00 (patch)
tree01ec27e6cddaaddedd5cf8d0d2786080359ec637
parent58ab1c64c5989bf6755c0b224b0d1813656d0e76 (diff)
downloadbootstrap-a69bc3bc095de588ae78b663f73395134ad6ee00.tar.xz
bootstrap-a69bc3bc095de588ae78b663f73395134ad6ee00.zip
move call for removeBackdrop() to backdrop()
Closes #11958 by rebasing & merging it
-rw-r--r--js/modal.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/modal.js b/js/modal.js
index a55363728..cbca61eed 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -145,7 +145,6 @@
var that = this
this.$element.hide()
this.backdrop(function () {
- that.removeBackdrop()
that.$element.trigger('hidden.bs.modal')
})
}
@@ -156,6 +155,7 @@
}
Modal.prototype.backdrop = function (callback) {
+ var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
@@ -186,11 +186,15 @@
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
+ var callbackRemove = function() {
+ that.removeBackdrop()
+ callback && callback()
+ }
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
- .one($.support.transition.end, callback)
+ .one($.support.transition.end, callbackRemove)
.emulateTransitionEnd(150) :
- callback()
+ callbackRemove()
} else if (callback) {
callback()