diff --git a/AppKit/CoreAnimation/CPAnimationContext.j b/AppKit/CoreAnimation/CPAnimationContext.j index 256b07ad9..a096525a2 100644 --- a/AppKit/CoreAnimation/CPAnimationContext.j +++ b/AppKit/CoreAnimation/CPAnimationContext.j @@ -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) diff --git a/AppKit/CoreAnimation/CPViewAnimator.j b/AppKit/CoreAnimation/CPViewAnimator.j index b15071c08..e9ef83098 100644 --- a/AppKit/CoreAnimation/CPViewAnimator.j +++ b/AppKit/CoreAnimation/CPViewAnimator.j @@ -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 {