diff --git a/1.3.0/bootstrap-alerts.js b/1.3.0/bootstrap-alerts.js index 82bcac52..de52da9b 100644 --- a/1.3.0/bootstrap-alerts.js +++ b/1.3.0/bootstrap-alerts.js @@ -18,7 +18,7 @@ * ========================================================== */ -(function( $ ){ +!function( $ ){ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ @@ -101,4 +101,4 @@ new Alert($('body'), '.alert-message[data-alert] .close') }) -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/1.3.0/bootstrap-dropdown.js b/1.3.0/bootstrap-dropdown.js index ca2daf1f..6c2f7030 100644 --- a/1.3.0/bootstrap-dropdown.js +++ b/1.3.0/bootstrap-dropdown.js @@ -18,7 +18,7 @@ * ============================================================ */ -(function( $ ){ +!function( $ ){ var d = 'a.menu, .dropdown-toggle' @@ -47,4 +47,4 @@ }) } -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/1.3.0/bootstrap-modal.js b/1.3.0/bootstrap-modal.js index d3e293ca..2335c39d 100644 --- a/1.3.0/bootstrap-modal.js +++ b/1.3.0/bootstrap-modal.js @@ -18,7 +18,7 @@ * ========================================================= */ -(function( $ ){ +!function( $ ){ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ @@ -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 = $('
') .appendTo(document.body) @@ -139,12 +143,15 @@ this.$backdrop.click($.proxy(this.hide, this)) } - setTimeout(function () { - that.$backdrop && that.$backdrop.addClass('in') - $.support.transition && that.$backdrop.hasClass('fade') ? - that.$backdrop.one(transitionEnd, callback) : - callback() - }, 0) + if ( doAnimate ) { + that.$backdrop[0].offsetWidth // force reflow + } + + that.$backdrop && that.$backdrop.addClass('in') + + doAnimate ? + that.$backdrop.one(transitionEnd, callback) : + callback() } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') @@ -165,13 +172,13 @@ function escape() { var that = this if ( this.isShown && this.settings.keyboard ) { - $('body').bind('keyup.modal', function ( e ) { + $(document).bind('keyup.modal', function ( e ) { if ( e.which == 27 ) { that.hide() } }) } else if ( !this.isShown ) { - $('body').unbind('keyup.modal') + $(document).unbind('keyup.modal') } } @@ -228,4 +235,4 @@ }) }) -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/1.3.0/bootstrap-popover.js b/1.3.0/bootstrap-popover.js index e41090a3..9964a28b 100644 --- a/1.3.0/bootstrap-popover.js +++ b/1.3.0/bootstrap-popover.js @@ -18,7 +18,7 @@ * =========================================================== */ -(function( $ ) { +!function( $ ) { var Popover = function ( element, options ) { this.$element = $(element) @@ -74,4 +74,4 @@ $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'}) -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/1.3.0/bootstrap-tabs.js b/1.3.0/bootstrap-tabs.js index 807b366a..1426d30e 100644 --- a/1.3.0/bootstrap-tabs.js +++ b/1.3.0/bootstrap-tabs.js @@ -18,7 +18,7 @@ * ======================================================== */ -(function( $ ){ +!function( $ ){ function activate ( element, container ) { container.find('.active').removeClass('active') @@ -59,4 +59,4 @@ $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a') }) -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/1.3.0/bootstrap-twipsy.js b/1.3.0/bootstrap-twipsy.js index bc92f97f..05b6f071 100644 --- a/1.3.0/bootstrap-twipsy.js +++ b/1.3.0/bootstrap-twipsy.js @@ -19,7 +19,7 @@ * ========================================================== */ -(function( $ ) { +!function( $ ) { /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ @@ -304,4 +304,4 @@ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options } -})( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery || window.ender ) \ No newline at end of file diff --git a/index.html b/index.html index 3efafec5..32f9784d 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ - + diff --git a/javascript.html b/javascript.html index ee2a569b..04a2430b 100644 --- a/javascript.html +++ b/javascript.html @@ -12,7 +12,7 @@ - + @@ -29,10 +29,10 @@ - - - - + + + +