diff options
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index a38ecb30..6066066a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -730,7 +730,17 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
730 | this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]; | 730 | this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]; |
731 | if(this.animatedElement!==undefined){ | 731 | if(this.animatedElement!==undefined){ |
732 | this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); | 732 | this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); |
733 | |||
734 | // check for multiple animation names | ||
735 | var animationNameList = this.animationName.split(","); | ||
736 | if(animationNameList.length > 1){ | ||
737 | this.animationName = animationNameList[0]; | ||
738 | this.extractKeyframesFromRules(animationNameList); | ||
739 | } | ||
740 | |||
733 | this.animationNamesString = this.animationName; | 741 | this.animationNamesString = this.animationName; |
742 | |||
743 | // build tweens for this tracks's keyframe rule | ||
734 | if(this.animationName){ | 744 | if(this.animationName){ |
735 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); | 745 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); |
736 | this.nextKeyframe = 0; | 746 | this.nextKeyframe = 0; |
@@ -796,6 +806,18 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
796 | } | 806 | } |
797 | }, | 807 | }, |
798 | 808 | ||
809 | extractKeyframesFromRules:{ | ||
810 | value:function(ruleNames){ | ||
811 | //console.log(ruleNames); | ||
812 | for(var i in ruleNames){ | ||
813 | console.log(ruleNames[i].replace(/^\s+|\s+$/g,"")); | ||
814 | var currName = ruleNames[i].replace(/^\s+|\s+$/g,""); | ||
815 | var test = this.application.ninja.stylesController.getAnimationRuleWithName(currName, this.application.ninja.currentDocument._document); | ||
816 | console.log(test); | ||
817 | } | ||
818 | } | ||
819 | }, | ||
820 | |||
799 | addAnimationRuleToElement:{ | 821 | addAnimationRuleToElement:{ |
800 | value:function (tweenEvent) { | 822 | value:function (tweenEvent) { |
801 | this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop; | 823 | this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop; |