diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-11 05:26:37 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-11 05:26:37 +0400 |
commit | 235246d6fcc7947d04555205a5f8a242eb3f6b97 (patch) | |
tree | 6760922718f5d7f0d3c843b1646dab96573b3ede /js/bootstrap-modal.js | |
parent | 9c76070cbddfd02c034cba9e15960906844b76d0 (diff) |
not feeling the slide in
Diffstat (limited to 'js/bootstrap-modal.js')
-rw-r--r-- | js/bootstrap-modal.js | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 81f265710d..4843d2b727 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -59,17 +59,16 @@ this.isShown = true _.escape.call(this) - _.backdrop.call(this, function () { + _.backdrop.call(this) - that.$element - .appendTo(document.body) - .show() + this.$element + .appendTo(document.body) + .show() - setTimeout(function () { - that.$element.addClass('in').trigger('modal:shown') - }, 1) - - }) + setTimeout(function () { + that.$element.addClass('in').trigger('modal:shown') + that.$backdrop && that.$backdrop.addClass('in') + }, 1) return this } @@ -82,12 +81,11 @@ this.isShown = false _.escape.call(this) + _.backdrop.call(this) this.$element.removeClass('in') function removeElement () { - _.backdrop.call(that) - that.$element .detach() .trigger('modal:hidden') @@ -108,21 +106,13 @@ var _ = { - backdrop: function ( callback ) { + backdrop: function () { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') .click($.proxy(this.hide, this)) .appendTo(document.body) - - setTimeout(function () { - that.$backdrop && that.$backdrop.addClass('in') - - $.support.transition && that.$backdrop.hasClass('fade')? - that.$backdrop.one(transitionEnd, callback) : - callback() - }) } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') |