css-animation
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -6,3 +6,3 @@ 'use strict'; | ||
module.exports = function (node, transitionName, callback) { | ||
var cssAnimation = function cssAnimation(node, transitionName, callback) { | ||
var className = transitionName; | ||
@@ -46,2 +46,50 @@ var activeClassName = className + '-active'; | ||
}, 0); | ||
}; | ||
}; | ||
cssAnimation.style = function (node, style, callback) { | ||
if (node.rcEndListener) { | ||
node.rcEndListener(); | ||
} | ||
node.rcEndListener = function (e) { | ||
if (e && e.target !== node) { | ||
return; | ||
} | ||
if (node.rcAnimTimeout) { | ||
clearTimeout(node.rcAnimTimeout); | ||
node.rcAnimTimeout = null; | ||
} | ||
Event.removeEndEventListener(node, node.rcEndListener); | ||
node.rcEndListener = null; | ||
// Usually this optional callback is used for informing an owner of | ||
// a leave animation and telling it to remove the child. | ||
if (callback) { | ||
callback(); | ||
} | ||
}; | ||
Event.addEndEventListener(node, node.rcEndListener); | ||
node.rcAnimTimeout = setTimeout(function () { | ||
for (var s in style) { | ||
node.style[s] = style[s]; | ||
} | ||
node.rcAnimTimeout = null; | ||
}, 0); | ||
}; | ||
cssAnimation.setTransition = function (node, v) { | ||
['Webkit', 'Moz', 'O', | ||
// ms is special .... ! | ||
'ms'].forEach(function (prefix) { | ||
node.style[prefix + 'Transition'] = v; | ||
}); | ||
}; | ||
cssAnimation.addClass = Css.addClass; | ||
cssAnimation.removeClass = Css.removeClass; | ||
module.exports = cssAnimation; |
{ | ||
"name": "css-animation", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "css-animation ui component for react", | ||
@@ -39,4 +39,3 @@ "keywords": [ | ||
"rc-tools": "3.x", | ||
"react": "0.13.x", | ||
"node-dev":"2.x" | ||
"react": "0.13.x" | ||
}, | ||
@@ -43,0 +42,0 @@ "precommit": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7891
5
158