diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 279 |
1 files changed, 208 insertions, 71 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 5206ae16..36c77018 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -67,10 +67,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
67 | 67 | ||
68 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ | 68 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ |
69 | _layerName:{ | 69 | _layerName:{ |
70 | serializable: true, | 70 | value: "Default Layer Name" |
71 | value:null, | ||
72 | writable:true, | ||
73 | enumerable:true | ||
74 | }, | 71 | }, |
75 | 72 | ||
76 | layerName:{ | 73 | layerName:{ |
@@ -79,20 +76,17 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
79 | return this._layerName; | 76 | return this._layerName; |
80 | }, | 77 | }, |
81 | set:function(newVal){ | 78 | set:function(newVal){ |
82 | if (newVal !== this._layerName) { | 79 | |
83 | this._layerEditable.value = newVal; | 80 | this._layerEditable.value = newVal; |
84 | this._layerName = newVal; | 81 | this._layerName = newVal; |
85 | this.layerData.layerName = newVal; | 82 | this.layerData.layerName = newVal; |
86 | this.log('layerName setter: ' + newVal) | 83 | if (typeof(this.dynamicLayerName) !== "undefined") { |
87 | } | 84 | this.dynamicLayerName.value = newVal; |
88 | 85 | } | |
89 | } | 86 | } |
90 | }, | 87 | }, |
91 | _layerID:{ | 88 | _layerID:{ |
92 | value:null, | 89 | value: "Default Layer ID" |
93 | writable:true, | ||
94 | serializable: true, | ||
95 | enumerable:true | ||
96 | }, | 90 | }, |
97 | 91 | ||
98 | layerID:{ | 92 | layerID:{ |
@@ -102,6 +96,21 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
102 | }, | 96 | }, |
103 | set:function(value){ | 97 | set:function(value){ |
104 | this._layerID = value; | 98 | this._layerID = value; |
99 | this.layerData.layerID = value; | ||
100 | } | ||
101 | }, | ||
102 | _layerTag:{ | ||
103 | value: "tag" | ||
104 | }, | ||
105 | |||
106 | layerTag:{ | ||
107 | serializable: true, | ||
108 | get:function(){ | ||
109 | return this._layerTag; | ||
110 | }, | ||
111 | set:function(newVal){ | ||
112 | this._layerTag = newVal; | ||
113 | this.layerData.layerTag = newVal; | ||
105 | } | 114 | } |
106 | }, | 115 | }, |
107 | 116 | ||
@@ -119,7 +128,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
119 | set:function(value){ | 128 | set:function(value){ |
120 | if (this._dtextPositionX !== value) { | 129 | if (this._dtextPositionX !== value) { |
121 | this._dtextPositionX = value; | 130 | this._dtextPositionX = value; |
122 | //this.needsDraw = true; | 131 | this.layerData.dtextPositionX = value; |
123 | } | 132 | } |
124 | 133 | ||
125 | } | 134 | } |
@@ -138,7 +147,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
138 | set:function(value){ | 147 | set:function(value){ |
139 | if (this._dtextPositionY !== value) { | 148 | if (this._dtextPositionY !== value) { |
140 | this._dtextPositionY = value; | 149 | this._dtextPositionY = value; |
141 | //this.needsDraw = true; | 150 | this.layerData.dtextPositionY = value; |
142 | } | 151 | } |
143 | 152 | ||
144 | } | 153 | } |
@@ -157,7 +166,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
157 | set:function(value){ | 166 | set:function(value){ |
158 | if (this._dtextScaleX !== value) { | 167 | if (this._dtextScaleX !== value) { |
159 | this._dtextScaleX = value; | 168 | this._dtextScaleX = value; |
160 | //this.needsDraw = true; | 169 | this.layerData.dtextScaleX = value; |
161 | } | 170 | } |
162 | 171 | ||
163 | } | 172 | } |
@@ -176,7 +185,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
176 | set:function(value){ | 185 | set:function(value){ |
177 | if (this._dtextScaleY !== value) { | 186 | if (this._dtextScaleY !== value) { |
178 | this._dtextScaleY = value; | 187 | this._dtextScaleY = value; |
179 | //this.needsDraw = true; | 188 | this.layerData.dtextScaleY = value; |
180 | } | 189 | } |
181 | 190 | ||
182 | } | 191 | } |
@@ -195,7 +204,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
195 | set:function(value){ | 204 | set:function(value){ |
196 | if (this._dtextSkewX !== value) { | 205 | if (this._dtextSkewX !== value) { |
197 | this._dtextSkewX = value; | 206 | this._dtextSkewX = value; |
198 | //this.needsDraw = true; | 207 | this.layerData.dtextSkewX = value; |
199 | } | 208 | } |
200 | 209 | ||
201 | } | 210 | } |
@@ -214,7 +223,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
214 | set:function(value){ | 223 | set:function(value){ |
215 | if (this._dtextSkewY !== value) { | 224 | if (this._dtextSkewY !== value) { |
216 | this._dtextSkewY = value; | 225 | this._dtextSkewY = value; |
217 | //this.needsDraw = true; | 226 | this.layerData.dtextSkewY = value; |
218 | } | 227 | } |
219 | 228 | ||
220 | } | 229 | } |
@@ -233,7 +242,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
233 | set:function(value){ | 242 | set:function(value){ |
234 | if (this._dtextRotate !== value) { | 243 | if (this._dtextRotate !== value) { |
235 | this._dtextRotate = value; | 244 | this._dtextRotate = value; |
236 | //this.needsDraw = true; | 245 | this.layerData.dtextRotate = value; |
237 | } | 246 | } |
238 | 247 | ||
239 | } | 248 | } |
@@ -278,6 +287,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
278 | }, | 287 | }, |
279 | set: function(newVal) { | 288 | set: function(newVal) { |
280 | this._isActive = newVal; | 289 | this._isActive = newVal; |
290 | this.layerData.isActive = newVal; | ||
281 | } | 291 | } |
282 | }, | 292 | }, |
283 | 293 | ||
@@ -294,8 +304,30 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
294 | }, | 304 | }, |
295 | set:function(value){ | 305 | set:function(value){ |
296 | this._isAnimated = value; | 306 | this._isAnimated = value; |
307 | this.layerData.isAnimated = value; | ||
308 | } | ||
309 | }, | ||
310 | _isVisible:{ | ||
311 | value: true | ||
312 | }, | ||
313 | |||
314 | isVisible:{ | ||
315 | get:function(){ | ||
316 | return this._isVisible; | ||
317 | }, | ||
318 | set:function(value){ | ||
319 | if (this._isVisible !== value) { | ||
320 | this._isVisible = value; | ||
321 | if (value === true) { | ||
322 | this.element.classList.remove("layer-hidden"); | ||
323 | } else { | ||
324 | this.element.classList.add("layer-hidden"); | ||
325 | } | ||
326 | } | ||
327 | this.layerData.isVisible = value; | ||
297 | } | 328 | } |
298 | }, | 329 | }, |
330 | |||
299 | _justAdded: { | 331 | _justAdded: { |
300 | value: false | 332 | value: false |
301 | }, | 333 | }, |
@@ -314,10 +346,9 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
314 | return this._isMainCollapsed; | 346 | return this._isMainCollapsed; |
315 | }, | 347 | }, |
316 | set: function(newVal) { | 348 | set: function(newVal) { |
317 | this.log('layer.js: isMainCollapsed: ' + newVal); | 349 | this._isMainCollapsed = newVal; |
318 | if (newVal !== this._isMainCollapsed) { | 350 | this.layerData.isMainCollapsed = newVal; |
319 | this._isMainCollapsed = newVal; | 351 | |
320 | } | ||
321 | } | 352 | } |
322 | }, | 353 | }, |
323 | 354 | ||
@@ -331,10 +362,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
331 | return this._isTransformCollapsed; | 362 | return this._isTransformCollapsed; |
332 | }, | 363 | }, |
333 | set: function(newVal) { | 364 | set: function(newVal) { |
334 | if (newVal !== this._isTransformCollapsed) { | 365 | this._isTransformCollapsed = newVal; |
335 | this._isTransformCollapsed = newVal; | 366 | this.layerData.isTransformCollapsed = newVal; |
336 | //this.needsDraw = true; | ||
337 | } | ||
338 | } | 367 | } |
339 | }, | 368 | }, |
340 | 369 | ||
@@ -348,10 +377,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
348 |