diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 388 |
1 files changed, 214 insertions, 174 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 16fb0303..4da1bfba 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -51,6 +51,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
51 | value: false | 51 | value: false |
52 | }, | 52 | }, |
53 | styleRepetition : { | 53 | styleRepetition : { |
54 | serializable: true, | ||
54 | get: function() { | 55 | get: function() { |
55 | return this._styleRepetition; | 56 | return this._styleRepetition; |
56 | }, | 57 | }, |
@@ -61,10 +62,39 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
61 | _styleCounter : { | 62 | _styleCounter : { |
62 | value: 0 | 63 | value: 0 |
63 | }, | 64 | }, |
65 | styleCounter:{ | ||
66 | serializable:true, | ||
67 | get:function () { | ||
68 | return this._styleCounter; | ||
69 | }, | ||
70 | set:function (newVal) { | ||
71 | this._styleCounter = newVal; | ||
72 | } | ||
73 | }, | ||
74 | _selectedStyleIndex: { | ||
75 | value: false | ||
76 | }, | ||
77 | selectedStyleIndex: { | ||
78 | get: function() { | ||
79 | return this._selectedStyleIndex; | ||
80 | }, | ||
81 | set: function(newVal) { | ||
82 | if (typeof(newVal) === "undefined") { | ||
83 | return; | ||
84 | } | ||
85 | if (newVal !== this._selectedStyleIndex) { | ||
86 | this._selectedStyleIndex = newVal; | ||
87 | this.layerData.selectedStyleIndex = newVal; | ||
88 | } | ||
89 | } | ||
90 | }, | ||
91 | _storedStyleIndex : { | ||
92 | value: false | ||
93 | }, | ||
64 | 94 | ||
65 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ | 95 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ |
66 | _layerName:{ | 96 | _layerName:{ |
67 | value: "Default Layer Name" | 97 | value: "" |
68 | }, | 98 | }, |
69 | 99 | ||
70 | layerName:{ | 100 | layerName:{ |
@@ -73,13 +103,22 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
73 | return this._layerName; | 103 | return this._layerName; |
74 | }, | 104 | }, |
75 | set:function(newVal){ | 105 | set:function(newVal){ |
106 | if (this._layerEditable.value !== newVal) { | ||
107 | this._layerEditable.value = newVal; | ||
108 | } | ||
109 | if (this._layerName !== newVal) { | ||
110 | this._layerName = newVal; | ||
111 | } | ||
112 | if (this.layerData.layerName !== newVal) { | ||
113 | this.layerData.layerName = newVal; | ||
114 | } | ||
76 | 115 | ||
77 | this._layerEditable.value = newVal; | ||
78 | this._layerName = newVal; | ||
79 | this.layerData.layerName = newVal; | ||
80 | if (typeof(this.dynamicLayerName) !== "undefined") { | 116 | if (typeof(this.dynamicLayerName) !== "undefined") { |
81 | this.dynamicLayerName.value = newVal; | 117 | if (this.dynamicLayerName.value !== newVal) { |
118 | this.dynamicLayerName.value = newVal; | ||
119 | } | ||
82 | } | 120 | } |
121 | this.needsDraw = true; | ||
83 | } | 122 | } |
84 | }, | 123 | }, |
85 | _layerID:{ | 124 | _layerID:{ |
@@ -123,6 +162,20 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
123 | } | 162 | } |
124 | }, | 163 | }, |
125 | 164 | ||
165 | _stageElement: { | ||
166 | value: null | ||
167 | }, | ||
168 | |||
169 | stageElement: { | ||
170 | get: function() { | ||
171 | return this._stageElement; | ||
172 | }, | ||
173 | set: function(newVal) { | ||
174 | this._stageElement = newVal; | ||
175 | this.layerData.stageElement = newVal; | ||
176 | } | ||
177 | }, | ||
178 | |||
126 | 179 | ||
127 | _elementsList : { | 180 | _elementsList : { |
128 | value: [] | 181 | value: [] |
@@ -137,7 +190,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
137 | } | 190 | } |
138 | }, | 191 | }, |
139 | 192 | ||
140 | /* Position and Transform hottext values */ | 193 | /* Position and Size hottext values */ |
141 | _dtextPositionX : { | 194 | _dtextPositionX : { |
142 | value:null | 195 | value:null |
143 | }, | 196 | }, |
@@ -210,60 +263,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
210 | } | 263 | } |
211 | }, | 264 | }, |
212 | 265 | ||
213 | _dtextSkewX : { | ||
214 | value:null | ||
215 | }, | ||
216 | |||
217 | dtextSkewX:{ | ||
218 | serializable: true, | ||
219 | get:function(){ | ||
220 | return this._dtextSkewX; | ||
221 | }, | ||
222 | set:function(value){ | ||
223 | if (this._dtextSkewX !== value) { | ||
224 | this._dtextSkewX = value; | ||
225 | this.layerData.dtextSkewX = value; | ||
226 | } | ||
227 | |||
228 | } | ||
229 | }, | ||
230 | |||
231 | _dtextSkewY : { | ||
232 | value:null | ||
233 | }, | ||
234 | |||
235 | dtextSkewY:{ | ||
236 | serializable: true, | ||
237 | get:function(){ | ||
238 | return this._dtextSkewY; | ||
239 | }, | ||
240 | set:function(value){ | ||
241 | if (this._dtextSkewY !== value) { | ||
242 | this._dtextSkewY = value; | ||
243 | this.layerData.dtextSkewY = value; | ||
244 | } | ||
245 | |||
246 | } | ||
247 | }, | ||
248 | |||
249 | _dtextRotate : { | ||
250 | value:null | ||
251 | }, | ||
252 | |||
253 | dtextRotate:{ | ||
254 | serializable: true, | ||
255 | get:function(){ | ||
256 | return this._dtextRotate; | ||
257 | }, | ||
258 | set:function(value){ | ||
259 | if (this._dtextRotate !== value) { | ||
260 | this._dtextRotate = value; | ||
261 | this.layerData.dtextRotate = value; | ||
262 | } | ||
263 | |||
264 | } | ||
265 | }, | ||
266 | |||
267 | /* isSelected: whether or not the layer is currently selected. */ | 266 | /* isSelected: whether or not the layer is currently selected. */ |
268 | _isSelected:{ | 267 | _isSelected:{ |
269 | value: false | 268 | value: false |
@@ -279,6 +278,10 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
279 | if (value === false) { | 278 | if (value === false) { |
280 | // If changing from true to false, we need to deselect any associated styles | 279 | // If changing from true to false, we need to deselect any associated styles |
281 | this.selectStyle(false); | 280 | this.selectStyle(false); |
281 | } else { | ||
282 | if (this._storedStyleIndex !== false) { | ||
283 | this.selectStyle(this._storedStyleIndex); | ||
284 | } | ||
282 | } | 285 | } |
283 | this._isSelected = value; | 286 | this._isSelected = value; |
284 | this.layerData.isSelected = value; | 287 | this.layerData.isSelected = value; |
@@ -362,20 +365,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
362 | } | 365 | } |
363 | }, | 366 | }, |
364 | 367 | ||
365 | _isTransformCollapsed : { | ||
366 | value: true | ||
367 | }, | ||
368 | isTransformCollapsed : { | ||
369 | serializable: true, | ||
370 | get: function() { | ||
371 | return this._isTransformCollapsed; | ||
372 | }, | ||
373 | set: function(newVal) { | ||
374 | this._isTransformCollapsed = newVal; | ||
375 | this.layerData.isTransformCollapsed = newVal; | ||
376 | } | ||
377 | }, | ||
378 | |||
379 | _isPositionCollapsed : { | 368 | _isPositionCollapsed : { |
380 | value: true | 369 | value: true |
381 | }, | 370 | }, |
@@ -456,10 +445,10 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
456 | 445 | ||
457 | this.layerName = this.layerData.layerName; | 446 | this.layerName = this.layerData.layerName; |
458 | this.layerID = this.layerData.layerID; | 447 | this.layerID = this.layerData.layerID; |
448 | this.stageElement = this.layerData.stageElement | ||
459 | this.arrLayerStyles = this.layerData.arrLayerStyles; | 449 | this.arrLayerStyles = this.layerData.arrLayerStyles; |
460 | this.isMainCollapsed = this.layerData.isMainCollapsed; | 450 | this.isMainCollapsed = this.layerData.isMainCollapsed; |
461 | this.isPositionCollapsed = this.layerData.isPositionCollapsed; | 451 | this.isPositionCollapsed = this.layerData.isPositionCollapsed; |
462 | this.isTransformCollapsed = this.layerData.i |