From 735be913e3fe4a694f7897a74eeb9038071b54c8 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Wed, 7 Aug 2013 00:54:59 -0400 Subject: [PATCH] fixes bug in testing for transitions in transition.js Former-commit-id: 69e7b9483c324172ffe08ce5ccf9711d2ceb27d7 Former-commit-id: 6be5ef29682617bdff67a14187e9728c15f4a8c7 --- build/minified/modules/transition.js | 14 ++++++++------ build/packaged/modules/transition.js | 14 ++++++++------ build/uncompressed/modules/transition.css | 6 ++++++ build/uncompressed/modules/transition.js | 14 ++++++++------ .../components/semantic/modules/transition.css | 6 ++++++ .../components/semantic/modules/transition.js | 14 ++++++++------ src/modules/transition.js | 14 ++++++++------ src/modules/transition.less | 6 ++++++ 8 files changed, 58 insertions(+), 30 deletions(-) diff --git a/build/minified/modules/transition.js b/build/minified/modules/transition.js index 7e96fd417..5c188a282 100644 --- a/build/minified/modules/transition.js +++ b/build/minified/modules/transition.js @@ -314,7 +314,7 @@ $.fn.transition = function() { animationName: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationName', 'OAnimation' :'oAnimationName', @@ -334,7 +334,7 @@ $.fn.transition = function() { animationEvent: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationend', 'OAnimation' :'oAnimationEnd', @@ -367,17 +367,18 @@ $.fn.transition = function() { }, transition: function() { var - currentAnimation = $module.css(animationName), - inAnimation = $module.addClass(className.inward).css(animationName) + $clone = $('
').addClass( $module.attr('class') ).appendTo($('body')), + currentAnimation = $clone.css(animationName), + inAnimation = $clone.addClass(className.inward).css(animationName) ; if(currentAnimation != inAnimation) { module.debug('In/out transitions exist'); - $module.removeClass(className.inward); + $clone.remove(); return true; } else { module.debug('Static animation found'); - $module.removeClass(className.inward); + $clone.remove(); return false; } } @@ -597,6 +598,7 @@ $.fn.transition.settings = { transition : 'ui transition', animating : 'animating', looping : 'looping', + loading : 'loading', disabled : 'disabled', hidden : 'hidden', visible : 'visible', diff --git a/build/packaged/modules/transition.js b/build/packaged/modules/transition.js index 7e96fd417..5c188a282 100644 --- a/build/packaged/modules/transition.js +++ b/build/packaged/modules/transition.js @@ -314,7 +314,7 @@ $.fn.transition = function() { animationName: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationName', 'OAnimation' :'oAnimationName', @@ -334,7 +334,7 @@ $.fn.transition = function() { animationEvent: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationend', 'OAnimation' :'oAnimationEnd', @@ -367,17 +367,18 @@ $.fn.transition = function() { }, transition: function() { var - currentAnimation = $module.css(animationName), - inAnimation = $module.addClass(className.inward).css(animationName) + $clone = $('
').addClass( $module.attr('class') ).appendTo($('body')), + currentAnimation = $clone.css(animationName), + inAnimation = $clone.addClass(className.inward).css(animationName) ; if(currentAnimation != inAnimation) { module.debug('In/out transitions exist'); - $module.removeClass(className.inward); + $clone.remove(); return true; } else { module.debug('Static animation found'); - $module.removeClass(className.inward); + $clone.remove(); return false; } } @@ -597,6 +598,7 @@ $.fn.transition.settings = { transition : 'ui transition', animating : 'animating', looping : 'looping', + loading : 'loading', disabled : 'disabled', hidden : 'hidden', visible : 'visible', diff --git a/build/uncompressed/modules/transition.css b/build/uncompressed/modules/transition.css index f52445d81..dfca81193 100644 --- a/build/uncompressed/modules/transition.css +++ b/build/uncompressed/modules/transition.css @@ -43,6 +43,12 @@ /******************************* States *******************************/ +/* Loading */ +.ui.loading.transition { + position: absolute; + top: -999999px; + left: -99999px; +} /* Hidden */ .ui.hidden.transition { display: none; diff --git a/build/uncompressed/modules/transition.js b/build/uncompressed/modules/transition.js index 7e96fd417..5c188a282 100644 --- a/build/uncompressed/modules/transition.js +++ b/build/uncompressed/modules/transition.js @@ -314,7 +314,7 @@ $.fn.transition = function() { animationName: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationName', 'OAnimation' :'oAnimationName', @@ -334,7 +334,7 @@ $.fn.transition = function() { animationEvent: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationend', 'OAnimation' :'oAnimationEnd', @@ -367,17 +367,18 @@ $.fn.transition = function() { }, transition: function() { var - currentAnimation = $module.css(animationName), - inAnimation = $module.addClass(className.inward).css(animationName) + $clone = $('
').addClass( $module.attr('class') ).appendTo($('body')), + currentAnimation = $clone.css(animationName), + inAnimation = $clone.addClass(className.inward).css(animationName) ; if(currentAnimation != inAnimation) { module.debug('In/out transitions exist'); - $module.removeClass(className.inward); + $clone.remove(); return true; } else { module.debug('Static animation found'); - $module.removeClass(className.inward); + $clone.remove(); return false; } } @@ -597,6 +598,7 @@ $.fn.transition.settings = { transition : 'ui transition', animating : 'animating', looping : 'looping', + loading : 'loading', disabled : 'disabled', hidden : 'hidden', visible : 'visible', diff --git a/node/src/files/components/semantic/modules/transition.css b/node/src/files/components/semantic/modules/transition.css index f52445d81..dfca81193 100644 --- a/node/src/files/components/semantic/modules/transition.css +++ b/node/src/files/components/semantic/modules/transition.css @@ -43,6 +43,12 @@ /******************************* States *******************************/ +/* Loading */ +.ui.loading.transition { + position: absolute; + top: -999999px; + left: -99999px; +} /* Hidden */ .ui.hidden.transition { display: none; diff --git a/node/src/files/components/semantic/modules/transition.js b/node/src/files/components/semantic/modules/transition.js index 7e96fd417..5c188a282 100644 --- a/node/src/files/components/semantic/modules/transition.js +++ b/node/src/files/components/semantic/modules/transition.js @@ -314,7 +314,7 @@ $.fn.transition = function() { animationName: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationName', 'OAnimation' :'oAnimationName', @@ -334,7 +334,7 @@ $.fn.transition = function() { animationEvent: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationend', 'OAnimation' :'oAnimationEnd', @@ -367,17 +367,18 @@ $.fn.transition = function() { }, transition: function() { var - currentAnimation = $module.css(animationName), - inAnimation = $module.addClass(className.inward).css(animationName) + $clone = $('
').addClass( $module.attr('class') ).appendTo($('body')), + currentAnimation = $clone.css(animationName), + inAnimation = $clone.addClass(className.inward).css(animationName) ; if(currentAnimation != inAnimation) { module.debug('In/out transitions exist'); - $module.removeClass(className.inward); + $clone.remove(); return true; } else { module.debug('Static animation found'); - $module.removeClass(className.inward); + $clone.remove(); return false; } } @@ -597,6 +598,7 @@ $.fn.transition.settings = { transition : 'ui transition', animating : 'animating', looping : 'looping', + loading : 'loading', disabled : 'disabled', hidden : 'hidden', visible : 'visible', diff --git a/src/modules/transition.js b/src/modules/transition.js index 7e96fd417..5c188a282 100755 --- a/src/modules/transition.js +++ b/src/modules/transition.js @@ -314,7 +314,7 @@ $.fn.transition = function() { animationName: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationName', 'OAnimation' :'oAnimationName', @@ -334,7 +334,7 @@ $.fn.transition = function() { animationEvent: function() { var - element = document.createElement('element'), + element = document.createElement('div'), animations = { 'animation' :'animationend', 'OAnimation' :'oAnimationEnd', @@ -367,17 +367,18 @@ $.fn.transition = function() { }, transition: function() { var - currentAnimation = $module.css(animationName), - inAnimation = $module.addClass(className.inward).css(animationName) + $clone = $('
').addClass( $module.attr('class') ).appendTo($('body')), + currentAnimation = $clone.css(animationName), + inAnimation = $clone.addClass(className.inward).css(animationName) ; if(currentAnimation != inAnimation) { module.debug('In/out transitions exist'); - $module.removeClass(className.inward); + $clone.remove(); return true; } else { module.debug('Static animation found'); - $module.removeClass(className.inward); + $clone.remove(); return false; } } @@ -597,6 +598,7 @@ $.fn.transition.settings = { transition : 'ui transition', animating : 'animating', looping : 'looping', + loading : 'loading', disabled : 'disabled', hidden : 'hidden', visible : 'visible', diff --git a/src/modules/transition.less b/src/modules/transition.less index c9bbbca19..c44b8baed 100755 --- a/src/modules/transition.less +++ b/src/modules/transition.less @@ -52,6 +52,12 @@ States *******************************/ +/* Loading */ +.ui.loading.transition { + position: absolute; + top: -999999px; + left: -99999px; +} /* Hidden */ .ui.hidden.transition {