Commit 422d04cb authored by Jacob Thornton's avatar Jacob Thornton

simplify transition plugin a little

parent 30b3f47e
...@@ -29,31 +29,30 @@ ...@@ -29,31 +29,30 @@
$.support.transition = (function () { $.support.transition = (function () {
var thisBody = document.body || document.documentElement var transitionEnd = (function () {
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined var el = document.createElement('bootstrap')
, transEndEventNames = {
return support && { 'WebkitTransition' : 'webkitTransitionEnd'
end: (function () { , 'MozTransition' : 'transitionend'
var el = document.createElement('bootstrap') , 'OTransition' : 'oTransitionEnd'
, transEndEventNames = { , 'msTransition' : 'MsTransitionEnd'
'WebkitTransition' : 'webkitTransitionEnd' , 'transition' : 'transitionend'
, 'MozTransition' : 'transitionend'
, 'OTransition' : 'oTransitionEnd'
, 'msTransition' : 'MsTransitionEnd'
, 'transition' : 'transitionend'
}
, name
for (name in transEndEventNames){
if (el.style[name] !== undefined) {
return transEndEventNames[name]
} }
, name
for (name in transEndEventNames){
if (el.style[name] !== undefined) {
return transEndEventNames[name]
} }
}
}()) })()
return transitionEnd && {
end: transitionEnd
} }
})() })()
}) })
......
...@@ -29,31 +29,30 @@ ...@@ -29,31 +29,30 @@
$.support.transition = (function () { $.support.transition = (function () {
var thisBody = document.body || document.documentElement var transitionEnd = (function () {
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined var el = document.createElement('bootstrap')
, transEndEventNames = {
return support && { 'WebkitTransition' : 'webkitTransitionEnd'
end: (function () { , 'MozTransition' : 'transitionend'
var el = document.createElement('bootstrap') , 'OTransition' : 'oTransitionEnd'
, transEndEventNames = { , 'msTransition' : 'MsTransitionEnd'
'WebkitTransition' : 'webkitTransitionEnd' , 'transition' : 'transitionend'
, 'MozTransition' : 'transitionend'
, 'OTransition' : 'oTransitionEnd'
, 'msTransition' : 'MsTransitionEnd'
, 'transition' : 'transitionend'
}
, name
for (name in transEndEventNames){
if (el.style[name] !== undefined) {
return transEndEventNames[name]
} }
, name
for (name in transEndEventNames){
if (el.style[name] !== undefined) {
return transEndEventNames[name]
} }
}
}()) })()
return transitionEnd && {
end: transitionEnd
} }
})() })()
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment