diff options
Diffstat (limited to 'js/bootstrap-modal.js')
| -rw-r--r-- | js/bootstrap-modal.js | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 2cc910989..9c57f6ddf 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -20,6 +20,8 @@ !function( $ ){ + "use strict" + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ @@ -115,17 +117,9 @@ .trigger('hide') .removeClass('in') - function removeElement () { - that.$element - .hide() - .trigger('hidden') - - backdrop.call(that) - } - $.support.transition && this.$element.hasClass('fade') ? - this.$element.one(transitionEnd, removeElement) : - removeElement() + this.$element.one(transitionEnd, $.proxy(hideModal, this)) : + hideModal.call(this) return this } @@ -136,6 +130,14 @@ /* MODAL PRIVATE METHODS * ===================== */ + function hideModal (that) { + this.$element + .hide() + .trigger('hidden') + + backdrop.call(this) + } + function backdrop ( callback ) { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' @@ -162,19 +164,20 @@ } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') - function removeElement() { - that.$backdrop.remove() - that.$backdrop = null - } - $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one(transitionEnd, removeElement) : - removeElement() + this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) : + removeBackdrop.call(this) + } else if ( callback ) { callback() } } + function removeBackdrop() { + this.$backdrop.remove() + this.$backdrop = null + } + function escape() { var that = this if ( this.isShown && this.settings.keyboard ) { |
