Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing css transition detector for IE10

  • Loading branch information...
commit 7c79e60c3c29faa78f5d5e404c9f9d6a54a238f6 1 parent 3772b22
@anutron authored
Showing with 18 additions and 18 deletions.
  1. +18 −18 Source/UI/CSSEvents.js
View
36 Source/UI/CSSEvents.js
@@ -14,24 +14,24 @@ provides: CSSEvents
*/
Browser.Features.getCSSTransition = function(){
- Browser.Features.cssTransition = (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;
- })();
-
- // set CSS transition event type
- if ( Browser.Features.cssTransition ) {
- Browser.Features.transitionEnd = "TransitionEnd";
- if ( Browser.safari || Browser.chrome ) {
- Browser.Features.transitionEnd = "webkitTransitionEnd";
- } else if ( Browser.firefox ) {
- Browser.Features.transitionEnd = "transitionend";
- } else if ( Browser.opera ) {
- Browser.Features.transitionEnd = "oTransitionEnd";
- }
- }
+ Browser.Features.transitionEnd = (function(){
+ var el = document.createElement('tmp');
+
+ var transEndEventNames = {
+ 'WebkitTransition' : 'webkitTransitionEnd'
+ , 'MozTransition' : 'transitionend'
+ , 'OTransition' : 'oTransitionEnd otransitionend'
+ , 'transition' : 'transitionend'
+ };
+
+ for (var name in transEndEventNames) {
+ if (el.style[name] !== undefined) {
+ return transEndEventNames[name];
+ }
+ }
+ })();
+ Browser.Features.cssTransition = !!Browser.Features.transitionEnd;
+
Browser.Features.getCSSTransition = Function.from(Browser.Features.transitionEnd);
};
Please sign in to comment.
Something went wrong with that request. Please try again.