aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js75
1 files changed, 58 insertions, 17 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 60da4e71..f2dbd683 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -27,6 +27,10 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
27 } 27 }
28 }, 28 },
29 29
30 trackEditorProperty:{
31 value:""
32 },
33
30 _propTweenRepetition:{ 34 _propTweenRepetition:{
31 value:null 35 value:null
32 }, 36 },
@@ -68,6 +72,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
68 }, 72 },
69 73
70 propTrackData:{ 74 propTrackData:{
75 serializable:true,
71 get:function () { 76 get:function () {
72 return this._propTrackData; 77 return this._propTrackData;
73 }, 78 },
@@ -79,19 +84,6 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
79 } 84 }
80 }, 85 },
81 86
82 setData:{
83 value:function(){
84 if (typeof(this.propTrackData) === "undefined") {
85 return;
86 }
87
88
89 this.propTweens = this.propTrackData.propTweens;
90
91 this.needsDraw = true;
92 }
93 },
94
95 nextKeyframe:{ 87 nextKeyframe:{
96 value:1 88 value:1
97 }, 89 },
@@ -108,16 +100,66 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
108 set:function (value) { 100 set:function (value) {
109 if (value !== this._trackID) { 101 if (value !== this._trackID) {
110 this._trackID = value; 102 this._trackID = value;
111 this.propTrackData.layerID = value;
112 } 103 }
113 } 104 }
114 }, 105 },
115 106
107 _styleSelection:{
108 value:null
109 },
110
111 styleSelection:{
112 serializable:true,
113 get:function () {
114 return this._styleSelection;
115 },
116 set:function (value) {
117 if (value !== this._styleSelection) {
118 this._styleSelection = value;
119 }
120 }
121 },
122
123 _styleIndex:{
124 value:null
125 },
126
127 styleIndex:{
128 serializable:true,
129 get:function () {
130 return this._styleIndex;
131 },
132 set:function (value) {
133 if (value !== this._styleIndex) {
134 this._styleIndex = value;
135 }
136 }
137 },
138
139 setData:{
140 value:function () {
141 if (typeof(this.propTrackData) === "undefined") {
142 return;
143 }
144
145 this.styleIndex = this.propTrackData.styleIndex;
146 this.propTweens = this.propTrackData.propTweens;
147 this.styleSelection = this.propTrackData.styleSelection;
148 this.needsDraw = true;
149 }
150 },
151
116 handleClick:{ 152 handleClick:{
117 value:function(ev){ 153 value:function(ev){
118 //console.log(this.application.ninja.timeline.arrLayers[selectedIndex].layerData);
119 if (ev.shiftKey) { 154 if (ev.shiftKey) {
120 if (this.propTweens.length < 1) { 155 if (this.propTweens.length < 1) {
156
157 // check if there is an editor property assigned yet
158 // get this property track's editor prop name from layer data arrays
159 var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
160 console.log(this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles);
161 console.log(this.styleIndex);
162
121 this.insertPropTween(0); 163 this.insertPropTween(0);
122 this.addPropAnimationRuleToElement(ev); 164 this.addPropAnimationRuleToElement(ev);
123 this.updatePropKeyframeRule(); 165 this.updatePropKeyframeRule();
@@ -137,8 +179,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
137 179
138 insertPropTween:{ 180 insertPropTween:{
139 value:function(clickPos){ 181 value:function(clickPos){
140 var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID; 182 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
141 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(parentTrackID);
142 this.application.ninja.timeline.selectLayer(selectedIndex, true); 183 this.application.ninja.timeline.selectLayer(selectedIndex, true);
143 184
144 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 185 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);