From: Jacob Thornton Date: Mon, 19 Sep 2011 04:03:52 +0000 (-0700) Subject: force reflow instead of relying on eventloop (firefox) X-Git-Tag: v1.4.0~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac8001190a4dda635a5df72f88e638759511bfd8;p=thirdparty%2Fbootstrap.git force reflow instead of relying on eventloop (firefox) listen to window for escape press --- diff --git a/docs/javascript.html b/docs/javascript.html index 61b0c8dc02..9f153c0bf6 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -12,7 +12,7 @@ - + diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 8b0ac2d02f..4201d843c2 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -85,11 +85,13 @@ .appendTo(document.body) .show() - setTimeout(function () { - that.$element - .addClass('in') - .trigger('shown') - }, 0) + if ($.support.transition && that.$element.hasClass('fade')) { + that.$backdrop[0].offsetWidth // force reflow + } + + that.$element + .addClass('in') + .trigger('shown') }) return this @@ -132,6 +134,8 @@ var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { + var doAnimate = $.support.transition && animate + this.$backdrop = $('