diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-30 00:51:23 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-03-30 00:51:23 +0400 |
commit | 422d04cb2b59ced380c2fa6dcb637dab70a916a3 (patch) | |
tree | 6f4ec2cd30fd31d2d7fa3e6773456ffe3c4f7263 /docs/assets/js/bootstrap-transition.js | |
parent | 30b3f47e31487b9f7db6a42ed633597c3f5e764c (diff) |
simplify transition plugin a little
Diffstat (limited to 'docs/assets/js/bootstrap-transition.js')
-rw-r--r-- | docs/assets/js/bootstrap-transition.js | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/docs/assets/js/bootstrap-transition.js b/docs/assets/js/bootstrap-transition.js index 028b03c848..b87d600713 100644 --- a/docs/assets/js/bootstrap-transition.js +++ b/docs/assets/js/bootstrap-transition.js @@ -29,31 +29,30 @@ $.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 } + })() }) |