aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js9
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js29
2 files changed, 32 insertions, 6 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 4fb3e43c..8df0e9ae 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -556,7 +556,7 @@ var Layer = exports.Layer = Montage.create(Component, {
556 } 556 }
557 }, 557 },
558 addStyle : { 558 addStyle : {
559 value: function() { 559 value: function(styleProperty) {
560 // Add a new style rule. It should be added above the currently selected rule, 560 // Add a new style rule. It should be added above the currently selected rule,
561 // Or at the end, if no rule is selected. 561 // Or at the end, if no rule is selected.
562 562
@@ -579,7 +579,12 @@ var Layer = exports.Layer = Montage.create(Component, {
579 579
580 newStyle.styleID = newEvent.styleID; 580 newStyle.styleID = newEvent.styleID;
581 newStyle.whichView = "hintable"; 581 newStyle.whichView = "hintable";
582 newStyle.editorProperty = ""; 582 newStyle.editorProperty = "";
583 if(styleProperty){
584 newStyle.editorProperty = styleProperty;
585 newEvent.layerEventType = "restoreStyle";
586 newEvent.trackEditorProperty = styleProperty;
587 }
583 newStyle.editorValue = ""; 588 newStyle.editorValue = "";
584 newStyle.ruleTweener = false; 589 newStyle.ruleTweener = false;
585 newStyle.isSelected = false; 590 newStyle.isSelected = false;
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index b195dbd6..a5722335 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -834,9 +834,17 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
834 834
835 recreatePropertyTracks:{ 835 recreatePropertyTracks:{
836 value:function(ruleSet){ 836 value:function(ruleSet){
837
838 //var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
839 //var test = this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle();
840 //console.log(test);
841
837 for(var i in ruleSet){ 842 for(var i in ruleSet){
838 //console.log(i); 843 console.log(i);
839 //console.log(ruleSet[i]); 844 //console.log(ruleSet[i]);
845 var styleProp = ruleSet[i][0].style[0];
846 console.log(styleProp);
847 this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp);
840 } 848 }
841 } 849 }
842 }, 850 },
@@ -958,9 +966,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
958 966
959 this.arrStyleTracks.push(newStyleTrack); 967 this.arrStyleTracks.push(newStyleTrack);
960 968
961 } else if (layerEvent.layerEventType === "deleteStyle") { 969 } else if (layerEvent.layerEventType === "restoreStyle") {
962 // TODO: Delete the right track. Index can be passed in event object, use that for splice(). 970 var restoredStyleTrack = {};
963 this.arrStyleTracks.pop(); 971 restoredStyleTrack.propTrackData = {};
972 restoredStyleTrack.propTrackData.styleSelection = layerEvent.styleSelection;
973 restoredStyleTrack.propTrackData.propTweens = [];
974 restoredStyleTrack.propTrackData.trackType = "style";
975 restoredStyleTrack.propTrackData.trackEditorProperty = layerEvent.trackEditorProperty;
976 restoredStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex;
977
978 this.arrStyleTracks.push(restoredStyleTrack);
979
980 this.isStyleCollapsed = true;
981 }
982 else if (layerEvent.layerEventType === "deleteStyle") {
983 // TODO: Delete the right track. Index can be passed in event object, use that for splice().
984 this.arrStyleTracks.pop();
964 } 985 }
965 } 986 }
966 }, 987 },