aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index e4e90d51..2fe60d72 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -730,13 +730,17 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
730 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.stageElement; 730 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.stageElement;
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
733 var animationNameList = this.animationName.split(","); 735 var animationNameList = this.animationName.split(",");
734 if(animationNameList.length > 1){ 736 if(animationNameList.length > 1){
735 this.animationName = animationNameList[0]; 737 this.animationName = animationNameList[0];
738 this.extractKeyframesFromRules(animationNameList);
736 } 739 }
737 740
738 this.animationNamesString = this.animationName; 741 this.animationNamesString = this.animationName;
739 742
743 // build tweens for this tracks's keyframe rule
740 if(this.animationName){ 744 if(this.animationName){
741 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 745 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration");
742 this.nextKeyframe = 0; 746 this.nextKeyframe = 0;
@@ -802,6 +806,18 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
802 } 806 }
803 }, 807 },
804 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
805 addAnimationRuleToElement:{ 821 addAnimationRuleToElement:{
806 value:function (tweenEvent) { 822 value:function (tweenEvent) {
807 this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop; 823 this.tweens[0].tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop;