vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js in twitter-bootstrap-rails-2.2.1 vs vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js in twitter-bootstrap-rails-2.2.3
- old
+ new
@@ -1,7 +1,7 @@
/* =========================================================
- * bootstrap-modal.js v2.2.2
+ * bootstrap-modal.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -58,12 +58,11 @@
if (!that.$element.parent().length) {
that.$element.appendTo(document.body) //don't move modals dom position
}
- that.$element
- .show()
+ that.$element.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
@@ -137,16 +136,17 @@
clearTimeout(timeout)
that.hideModal()
})
}
- , hideModal: function (that) {
- this.$element
- .hide()
- .trigger('hidden')
-
- this.backdrop()
+ , hideModal: function () {
+ var that = this
+ this.$element.hide()
+ this.backdrop(function () {
+ that.removeBackdrop()
+ that.$element.trigger('hidden')
+ })
}
, removeBackdrop: function () {
this.$backdrop.remove()
this.$backdrop = null
@@ -170,19 +170,21 @@
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
+ if (!callback) return
+
doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
- this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
- this.removeBackdrop()
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
} else if (callback) {
callback()
}
}