diff options
| author | Jacob Thornton <[email protected]> | 2011-08-28 16:47:38 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-08-28 16:47:38 -0700 |
| commit | f1d17223b8a96aea5e11e289cddc488aaeb40f22 (patch) | |
| tree | cf22d297fa384099097abd235ec7e4264bde53b6 | |
| parent | a0cb72f9ae27ded4cf3516e0d3edd042293d9e39 (diff) | |
| download | bootstrap-f1d17223b8a96aea5e11e289cddc488aaeb40f22.tar.xz bootstrap-f1d17223b8a96aea5e11e289cddc488aaeb40f22.zip | |
wrap for domready
| -rw-r--r-- | examples/assets/js/bootstrap-alerts.js | 45 | ||||
| -rw-r--r-- | examples/assets/js/bootstrap-dropdown.js | 4 | ||||
| -rw-r--r-- | examples/assets/js/bootstrap-modal.js | 57 | ||||
| -rw-r--r-- | examples/assets/js/bootstrap-twipsy.js | 46 |
4 files changed, 76 insertions, 76 deletions
diff --git a/examples/assets/js/bootstrap-alerts.js b/examples/assets/js/bootstrap-alerts.js index f6a5f9711..53692f8e2 100644 --- a/examples/assets/js/bootstrap-alerts.js +++ b/examples/assets/js/bootstrap-alerts.js @@ -3,31 +3,30 @@ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - - /* SHARED VARS - * =========== */ - var transitionEnd - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" - } - } - + $(function () { + + $.support.transition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined + return support + })() + + // set CSS transition event type + if ( $.support.transition ) { + transitionEnd = "TransitionEnd" + if ( $.browser.webkit ) { + transitionEnd = "webkitTransitionEnd" + } else if ( $.browser.mozilla ) { + transitionEnd = "transitionend" + } else if ( $.browser.opera ) { + transitionEnd = "oTransitionEnd" + } + } + + }) /* ALERT CLASS DEFINITION * ====================== */ diff --git a/examples/assets/js/bootstrap-dropdown.js b/examples/assets/js/bootstrap-dropdown.js index b319c818c..80c0c2405 100644 --- a/examples/assets/js/bootstrap-dropdown.js +++ b/examples/assets/js/bootstrap-dropdown.js @@ -7,7 +7,9 @@ $('a.menu').parent('li').removeClass('open') } - $('body').bind("click", clearMenus) + $(function () { + $(window).bind("click", clearMenus) + }) $.fn.dropdown = function ( options ) { return this.each(function () { diff --git a/examples/assets/js/bootstrap-modal.js b/examples/assets/js/bootstrap-modal.js index d03651faf..858e63c56 100644 --- a/examples/assets/js/bootstrap-modal.js +++ b/examples/assets/js/bootstrap-modal.js @@ -1,33 +1,32 @@ (function( $ ){ - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - - /* SHARED VARS - * =========== */ - - var $window = $('body') - , transitionEnd - - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) + * ======================================================= */ + + var transitionEnd + + $(function () { + + $.support.transition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined + return support + })() + + // set CSS transition event type + if ( $.support.transition ) { + transitionEnd = "TransitionEnd" + if ( $.browser.webkit ) { + transitionEnd = "webkitTransitionEnd" + } else if ( $.browser.mozilla ) { + transitionEnd = "transitionend" + } else if ( $.browser.opera ) { + transitionEnd = "oTransitionEnd" + } } - } + + }) /* MODAL PUBLIC CLASS DEFINITION @@ -127,13 +126,13 @@ , escape: function () { var that = this if ( this.isOpen && this.settings.closeOnEscape ) { - $window.bind('keyup.modal.escape', function ( e ) { + $(window).bind('keyup.modal.escape', function ( e ) { if ( e.which == 27 ) { that.close() } }) } else if ( !this.isOpen ) { - $window.unbind('keyup.modal.escape') + $(window).unbind('keyup.modal.escape') } } diff --git a/examples/assets/js/bootstrap-twipsy.js b/examples/assets/js/bootstrap-twipsy.js index 2d17796e1..3d117a445 100644 --- a/examples/assets/js/bootstrap-twipsy.js +++ b/examples/assets/js/bootstrap-twipsy.js @@ -2,33 +2,33 @@ (function( $ ) { - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - - /* SHARED VARS - * =========== */ + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) + * ======================================================= */ var transitionEnd - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" + $(function () { + + $.support.transition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined + return support + })() + + // set CSS transition event type + if ( $.support.transition ) { + transitionEnd = "TransitionEnd" + if ( $.browser.webkit ) { + transitionEnd = "webkitTransitionEnd" + } else if ( $.browser.mozilla ) { + transitionEnd = "transitionend" + } else if ( $.browser.opera ) { + transitionEnd = "oTransitionEnd" + } } - } + + }) /* TWIPSY PUBLIC CLASS DEFINITION |
