]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
simplify transition plugin a little
authorJacob Thornton <jacobthornton@gmail.com>
Thu, 29 Mar 2012 20:51:23 +0000 (13:51 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Thu, 29 Mar 2012 20:51:23 +0000 (13:51 -0700)
docs/assets/bootstrap.zip
docs/assets/js/bootstrap-transition.js
js/bootstrap-transition.js

index 50e92b3e34c9a810a2f4bb3ade7f2b038dccfcf8..9b020732171d6b21530202e4785943b62d66f505 100644 (file)
Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ
index 028b03c848f57818a383da10e929dca7ae4a1eb6..b87d6007136432014faf1e20726504bfe3834ab1 100644 (file)
 
     $.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 && {
-        end: (function () {
-          var el = document.createElement('bootstrap')
-            , transEndEventNames = {
-                 'WebkitTransition' : 'webkitTransitionEnd'
-              ,  'MozTransition'    : 'transitionend'
-              ,  'OTransition'      : 'oTransitionEnd'
-              ,  'msTransition'     : 'MsTransitionEnd'
-              ,  'transition'       : 'transitionend'
-              }
-            , name
-
-          for (name in transEndEventNames){
-            if (el.style[name] !== undefined) {
-              return transEndEventNames[name]
+      var transitionEnd = (function () {
+
+        var el = document.createElement('bootstrap')
+          , transEndEventNames = {
+               'WebkitTransition' : 'webkitTransitionEnd'
+            ,  'MozTransition'    : 'transitionend'
+            ,  'OTransition'      : 'oTransitionEnd'
+            ,  'msTransition'     : 'MsTransitionEnd'
+            ,  'transition'       : 'transitionend'
             }
+          , name
+
+        for (name in transEndEventNames){
+          if (el.style[name] !== undefined) {
+            return transEndEventNames[name]
           }
+        }
 
-        }())
+      })()
 
+      return transitionEnd && {
+        end: transitionEnd
       }
+
     })()
 
   })
index 028b03c848f57818a383da10e929dca7ae4a1eb6..b87d6007136432014faf1e20726504bfe3834ab1 100644 (file)
 
     $.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 && {
-        end: (function () {
-          var el = document.createElement('bootstrap')
-            , transEndEventNames = {
-                 'WebkitTransition' : 'webkitTransitionEnd'
-              ,  'MozTransition'    : 'transitionend'
-              ,  'OTransition'      : 'oTransitionEnd'
-              ,  'msTransition'     : 'MsTransitionEnd'
-              ,  'transition'       : 'transitionend'
-              }
-            , name
-
-          for (name in transEndEventNames){
-            if (el.style[name] !== undefined) {
-              return transEndEventNames[name]
+      var transitionEnd = (function () {
+
+        var el = document.createElement('bootstrap')
+          , transEndEventNames = {
+               'WebkitTransition' : 'webkitTransitionEnd'
+            ,  'MozTransition'    : 'transitionend'
+            ,  'OTransition'      : 'oTransitionEnd'
+            ,  'msTransition'     : 'MsTransitionEnd'
+            ,  'transition'       : 'transitionend'
             }
+          , name
+
+        for (name in transEndEventNames){
+          if (el.style[name] !== undefined) {
+            return transEndEventNames[name]
           }
+        }
 
-        }())
+      })()
 
+      return transitionEnd && {
+        end: transitionEnd
       }
+
     })()
 
   })