From e063ff5e54fb1256ed65b68583752c9d52dc249b Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sun, 12 Jun 2016 10:20:26 +0200 Subject: [PATCH] Remove CPAnimationTriggerOrderIn partial support. Adds a warning if someone tries to use it. --- AppKit/CoreAnimation/CPViewAnimator.j | 38 ++++++--------------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/AppKit/CoreAnimation/CPViewAnimator.j b/AppKit/CoreAnimation/CPViewAnimator.j index b2e811e3b..b26b11bb5 100644 --- a/AppKit/CoreAnimation/CPViewAnimator.j +++ b/AppKit/CoreAnimation/CPViewAnimator.j @@ -6,35 +6,6 @@ { } -- (void)viewWillMoveToSuperview:(CPView)aSuperview -{ - var orderInAnim = [self animationForKey:@"CPAnimationTriggerOrderIn"]; - - if (orderInAnim && [orderInAnim isKindOfClass:[CAPropertyAnimation class]]) - { - [_target setValue:[orderInAnim fromValue] forKeyPath:[orderInAnim keyPath]]; - } - - [_target viewWillMoveToSuperview:aSuperview]; -} - -- (void)viewDidMoveToSuperview -{ - var orderInAnim = [self animationForKey:@"CPAnimationTriggerOrderIn"]; - - if (orderInAnim && [orderInAnim isKindOfClass:[CAPropertyAnimation class]]) - { - [self _setTargetValue:YES withKeyPath:@"CPAnimationTriggerOrderIn" fallback:nil completion:function() - { - [_target setValue:[orderInAnim toValue] forKeyPath:[orderInAnim keyPath]]; - }]; - } - else - { - [_target viewDidMoveToSuperview]; - } -} - - (void)removeFromSuperview { [self _setTargetValue:nil withKeyPath:@"CPAnimationTriggerOrderOut" setter:_cmd]; @@ -190,6 +161,13 @@ var DEFAULT_CSS_PROPERTIES = nil; + (CAAnimation)defaultAnimationForKey:(CPString)aKey { + // TODO: remove when supported. + if (aKey == @"CPAnimationTriggerOrderIn") + { + CPLog.warn("CPView animated key path CPAnimationTriggerOrderIn is not supported yet."); + return nil; + } + if ([self cssPropertiesForKeyPath:aKey] !== nil) return [CAAnimation animation]; @@ -219,4 +197,4 @@ var DEFAULT_CSS_PROPERTIES = nil; _animationsDictionary = [animationsDict copy]; } -@end \ No newline at end of file +@end