]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
wrap for domready
authorJacob Thornton <jacobthornton@gmail.com>
Sun, 28 Aug 2011 23:47:38 +0000 (16:47 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Sun, 28 Aug 2011 23:47:38 +0000 (16:47 -0700)
examples/assets/js/bootstrap-alerts.js
examples/assets/js/bootstrap-dropdown.js
examples/assets/js/bootstrap-modal.js
examples/assets/js/bootstrap-twipsy.js

index f6a5f971146154ddbc518b5a801dfe4650174d69..53692f8e2ee75142aac0b8e409e1b52a5bbdc28a 100644 (file)
@@ -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
   * ====================== */
index b319c818cf4f37ec6f057955df9da9e3554fabf7..80c0c24050ebd811f480824110efbd230df1dde3 100644 (file)
@@ -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 () {
index d03651fafe8eaaae89c716696f6a2d72659b1d3c..858e63c56d3e2880564a9f4a5b99ffd5c64ca44b 100644 (file)
@@ -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
   , 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')
       }
     }
 
index 2d17796e13d31b7556699841a48904685dc2f23d..3d117a4453859ddd5bcecde4e973bc74c3201aa6 100644 (file)
@@ -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