mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-23 18:40:03 +00:00
replace UA sniffing
This commit is contained in:
parent
2bbc9a1cb2
commit
8ea8c312ea
Binary file not shown.
29
docs/assets/js/bootstrap-transition.js
vendored
29
docs/assets/js/bootstrap-transition.js
vendored
@ -24,28 +24,35 @@
|
|||||||
|
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
/* CSS TRANSITION SUPPORT (technique from http://www.modernizr.com/)
|
||||||
* ======================================================= */
|
* ======================================================= */
|
||||||
|
|
||||||
$.support.transition = (function () {
|
$.support.transition = (function () {
|
||||||
|
|
||||||
var thisBody = document.body || document.documentElement
|
var thisBody = document.body || document.documentElement
|
||||||
, thisStyle = thisBody.style
|
, thisStyle = thisBody.style
|
||||||
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
||||||
|
|
||||||
return support && {
|
return support && {
|
||||||
end: (function () {
|
end: (function () {
|
||||||
var transitionEnd = "TransitionEnd"
|
var el = document.createElement('bootstrap')
|
||||||
if ( $.browser.webkit ) {
|
, transEndEventNames = {
|
||||||
transitionEnd = "webkitTransitionEnd"
|
'WebkitTransition' : 'webkitTransitionEnd'
|
||||||
} else if ( $.browser.mozilla ) {
|
, 'MozTransition' : 'transitionend'
|
||||||
transitionEnd = "transitionend"
|
, 'OTransition' : 'oTransitionEnd'
|
||||||
} else if ( $.browser.msie ) {
|
, 'msTransition' : 'MsTransitionEnd'
|
||||||
transitionEnd = "MSTransitionEnd"
|
, 'transition' : 'transitionend'
|
||||||
} else if ( $.browser.opera ) {
|
}
|
||||||
transitionEnd = "oTransitionEnd"
|
, name
|
||||||
|
|
||||||
|
for (name in transEndEventNames){
|
||||||
|
if (el.style[name] !== undefined) {
|
||||||
|
return transEndEventNames[name]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return transitionEnd
|
|
||||||
}())
|
}())
|
||||||
|
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
29
js/bootstrap-transition.js
vendored
29
js/bootstrap-transition.js
vendored
@ -24,28 +24,35 @@
|
|||||||
|
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
|
/* CSS TRANSITION SUPPORT (technique from http://www.modernizr.com/)
|
||||||
* ======================================================= */
|
* ======================================================= */
|
||||||
|
|
||||||
$.support.transition = (function () {
|
$.support.transition = (function () {
|
||||||
|
|
||||||
var thisBody = document.body || document.documentElement
|
var thisBody = document.body || document.documentElement
|
||||||
, thisStyle = thisBody.style
|
, thisStyle = thisBody.style
|
||||||
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
|
||||||
|
|
||||||
return support && {
|
return support && {
|
||||||
end: (function () {
|
end: (function () {
|
||||||
var transitionEnd = "TransitionEnd"
|
var el = document.createElement('bootstrap')
|
||||||
if ( $.browser.webkit ) {
|
, transEndEventNames = {
|
||||||
transitionEnd = "webkitTransitionEnd"
|
'WebkitTransition' : 'webkitTransitionEnd'
|
||||||
} else if ( $.browser.mozilla ) {
|
, 'MozTransition' : 'transitionend'
|
||||||
transitionEnd = "transitionend"
|
, 'OTransition' : 'oTransitionEnd'
|
||||||
} else if ( $.browser.msie ) {
|
, 'msTransition' : 'MsTransitionEnd'
|
||||||
transitionEnd = "MSTransitionEnd"
|
, 'transition' : 'transitionend'
|
||||||
} else if ( $.browser.opera ) {
|
}
|
||||||
transitionEnd = "oTransitionEnd"
|
, name
|
||||||
|
|
||||||
|
for (name in transEndEventNames){
|
||||||
|
if (el.style[name] !== undefined) {
|
||||||
|
return transEndEventNames[name]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return transitionEnd
|
|
||||||
}())
|
}())
|
||||||
|
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user