mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 16:44:17 +02:00
simplify transition plugin a little
This commit is contained in:
Binary file not shown.
37
docs/assets/js/bootstrap-transition.js
vendored
37
docs/assets/js/bootstrap-transition.js
vendored
@@ -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
|
|
||||||
|
|
||||||
return support && {
|
var el = document.createElement('bootstrap')
|
||||||
end: (function () {
|
, transEndEventNames = {
|
||||||
var el = document.createElement('bootstrap')
|
'WebkitTransition' : 'webkitTransitionEnd'
|
||||||
, transEndEventNames = {
|
, 'MozTransition' : 'transitionend'
|
||||||
'WebkitTransition' : 'webkitTransitionEnd'
|
, 'OTransition' : 'oTransitionEnd'
|
||||||
, 'MozTransition' : 'transitionend'
|
, 'msTransition' : 'MsTransitionEnd'
|
||||||
, 'OTransition' : 'oTransitionEnd'
|
, 'transition' : 'transitionend'
|
||||||
, '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
|
||||||
}
|
}
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
37
js/bootstrap-transition.js
vendored
37
js/bootstrap-transition.js
vendored
@@ -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
|
|
||||||
|
|
||||||
return support && {
|
var el = document.createElement('bootstrap')
|
||||||
end: (function () {
|
, transEndEventNames = {
|
||||||
var el = document.createElement('bootstrap')
|
'WebkitTransition' : 'webkitTransitionEnd'
|
||||||
, transEndEventNames = {
|
, 'MozTransition' : 'transitionend'
|
||||||
'WebkitTransition' : 'webkitTransitionEnd'
|
, 'OTransition' : 'oTransitionEnd'
|
||||||
, 'MozTransition' : 'transitionend'
|
, 'msTransition' : 'MsTransitionEnd'
|
||||||
, 'OTransition' : 'oTransitionEnd'
|
, 'transition' : 'transitionend'
|
||||||
, '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
|
||||||
}
|
}
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user