mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-25 17:45:36 +00:00
Code style. NEW CPView -DOMElementForKeyPath:keyPath:
-DOMElementForKeyPath:keyPath returns the DOMElement animated by the css Animation. This allow for an element different from the view _DOMElement to be animated.
This commit is contained in:
1 parent
cd7b9d31c9
commit
6df9b95dea
1 file changed
+13
-10
@@ -273,17 +273,23 @@ CPLog.debug(_cmd + "context stack =" + _CPAnimationContextStack);
|
||||
timingFunctions = anAction.timingfunctions,
|
||||
properties = [],
|
||||
valueFunctions = [],
|
||||
createNewAnimation,
|
||||
cssAnimation;
|
||||
cssAnimation = nil;
|
||||
|
||||
var animIdx = [cssAnimations indexOfObjectPassingTest:function(anim, idx, stop)
|
||||
[cssAnimations enumerateObjectsUsingBlock:function(anim, idx, stop)
|
||||
{
|
||||
return (anim.identifier == identifier);
|
||||
if (anim.identifier == identifier)
|
||||
{
|
||||
cssAnimation = anim;
|
||||
stop(YES);
|
||||
}
|
||||
}];
|
||||
|
||||
createNewAnimation = (animIdx === CPNotFound);
|
||||
|
||||
cssAnimation = createNewAnimation ? new CSSAnimation(aTargetView._DOMElement, identifier) : cssAnimations[animIdx];
|
||||
if (cssAnimation == nil)
|
||||
{
|
||||
var domElement = [aTargetView DOMElementForKeyPath:keyPath];
|
||||
cssAnimation = new CSSAnimation(domElement, identifier);
|
||||
cssAnimations.push(cssAnimation);
|
||||
}
|
||||
|
||||
[[aTargetView class] getCSSProperties:properties valueFunctions:valueFunctions forKeyPath:keyPath];
|
||||
|
||||
@@ -296,9 +302,6 @@ CPLog.debug(_cmd + "context stack =" + _CPAnimationContextStack);
|
||||
|
||||
if (needsFrameTimer)
|
||||
cssAnimation.setRemoveAnimationPropertyOnCompletion(false);
|
||||
|
||||
if (createNewAnimation)
|
||||
cssAnimations.push(cssAnimation);
|
||||
}
|
||||
|
||||
if (needsFrameTimer)
|
||||
|
||||
Reference in new issue
Block a user