Allow nil completionFunction and fix fallback == nil

This commit is contained in:
cacaodev committed 2015-03-13 18:52:05 +01:00
1 parent 9844550d6c
commit e9ae8063db
2 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -130,7 +130,7 @@ CPLog.debug(_cmd + "context stack =" + _CPAnimationContextStack);
var animByKeyPath = _animationsByObject.get(anObject);
if (!animByKeyPath)
{
var newAnimByKeyPath = [CPDictionary dictionaryWithObject:resolvedAction forKey:aKeyPath];
var newAnimByKeyPath = @{aKeyPath:resolvedAction};
_animationsByObject.put(anObject, newAnimByKeyPath);
}
else
@@ -163,7 +163,7 @@ CPLog.debug(_cmd + "context stack =" + _CPAnimationContextStack);
{
if (needsFrameTimer)
[self stopFrameUpdaterWithIdentifier:objectId];
else
else if (animationCompletion)
animationCompletion();
if (_completionHandlerAgent)
+3 -2
View File
@@ -65,9 +65,10 @@
var animation = [_target animationForKey:aKeyPath],
context = [CPAnimationContext currentContext];
if ((!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations]) && fallback !== nil)
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations])
{
fallback();
if (fallback)
fallback();
}
else
{