diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 127 |
1 files changed, 18 insertions, 109 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index c213cb70..130dd044 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,8 +62,17 @@ 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 | }, | ||
64 | 74 | ||
65 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ | 75 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ |
66 | _layerName:{ | 76 | _layerName:{ |
67 | value: "Default Layer Name" | 77 | value: "Default Layer Name" |
68 | }, | 78 | }, |
@@ -137,7 +147,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
137 | } | 147 | } |
138 | }, | 148 | }, |
139 | 149 | ||
140 | /* Position and Transform hottext values */ | 150 | /* Position and Size hottext values */ |
141 | _dtextPositionX : { | 151 | _dtextPositionX : { |
142 | value:null | 152 | value:null |
143 | }, | 153 | }, |
@@ -210,60 +220,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
210 | } | 220 | } |
211 | }, | 221 | }, |
212 | 222 | ||
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. */ | 223 | /* isSelected: whether or not the layer is currently selected. */ |
268 | _isSelected:{ | 224 | _isSelected:{ |
269 | value: false | 225 | value: false |
@@ -362,20 +318,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
362 | } | 318 | } |
363 | }, | 319 | }, |
364 | 320 | ||
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 : { | 321 | _isPositionCollapsed : { |
380 | value: true | 322 | value: true |
381 | }, | 323 | }, |
@@ -459,7 +401,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
459 | this.arrLayerStyles = this.layerData.arrLayerStyles; | 401 | this.arrLayerStyles = this.layerData.arrLayerStyles; |
460 | this.isMainCollapsed = this.layerData.isMainCollapsed; | 402 | this.isMainCollapsed = this.layerData.isMainCollapsed; |
461 | this.isPositionCollapsed = this.layerData.isPositionCollapsed; | 403 | this.isPositionCollapsed = this.layerData.isPositionCollapsed; |
462 | this.isTransformCollapsed = this.layerData.isTransformCollapsed; | ||
463 | this.isSelected = this.layerData.isSelected; | 404 | this.isSelected = this.layerData.isSelected; |
464 | this.isActive = this.layerData.isActive; | 405 | this.isActive = this.layerData.isActive; |
465 | this.isStyleCollapsed = this.layerData.isStyleCollapsed; | 406 | this.isStyleCollapsed = this.layerData.isStyleCollapsed; |
@@ -527,7 +468,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
527 | // Collapser event handlers. | 468 | // Collapser event handlers. |
528 | this.mainCollapser.clicker.addEventListener("click", this.handleMainCollapserClick.bind(this), false); | 469 | this.mainCollapser.clicker.addEventListener("click", this.handleMainCollapserClick.bind(this), false); |
529 | this.positionCollapser.clicker.addEventListener("click", this.handlePositionCollapserClick.bind(this), false); | 470 | this.positionCollapser.clicker.addEventListener("click", this.handlePositionCollapserClick.bind(this), false); |
530 | this.transformCollapser.clicker.addEventListener("click", this.handleTransformCollapserClick.bind(this), false); | ||
531 | this.styleCollapser.clicker.addEventListener("click", this.handleStyleCollapserClick.bind(this), false); | 471 | this.styleCollapser.clicker.addEventListener("click", this.handleStyleCollapserClick.bind(this), false); |
532 | 472 | ||
533 | // Add event listeners to add and delete style buttons | 473 | // Add event listeners to add and delete style buttons |
@@ -585,11 +525,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
585 | this.positionCollapser.myContent.classList.remove(this.positionCollapser.collapsedClass); | 525 | this.positionCollapser.myContent.classList.remove(this.positionCollapser.collapsedClass); |
586 | this.positionCollapser.clicker.classList.remove(this.positionCollapser.collapsedClass); | 526 | this.positionCollapser.clicker.classList.remove(this.positionCollapser.collapsedClass); |
587 | } | 527 | } |
588 | if (this.isTransformCollapsed === false) { | ||
589 | this.transformCollapser.myContent.style.height = "auto"; | ||
590 | this.transformCollapser.myContent.classList.remove(this.transformCollapser.collapsedClass); | ||
591 | this.transformCollapser.clicker.classList.remove(this.transformCollapser.collapsedClass); | ||
592 | } | ||
593 | if (this.isStyleCollapsed === false) { | 528 | if (this.isStyleCollapsed === false) { |
594 | this.styleCollapser.myContent.style.height = "auto"; | 529 | this.styleCollapser.myContent.style.height = "auto"; |
595 | this.styleCollapser.myContent.classList.remove(this.styleCollapser.collapsedClass); | 530 | this.styleCollapser.myContent.classList.remove(this.styleCollapser.collapsedClass); |
@@ -622,7 +557,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
622 | // Or at the end, if no rule is selected. | 557 | // Or at the end, if no rule is selected. |
623 | 558 | ||
624 | var newLength = 0, | 559 | var newLength = 0, |
625 | mySelection = 0, | 560 | // mySelection = 0, |
626 | // newStyle = LayerStyle.create(), | 561 | // newStyle = LayerStyle.create(), |
627 | newStyle = {}, | 562 | newStyle = {}, |
628 | newEvent = document.createEvent("CustomEvent"); | 563 | newEvent = document.createEvent("CustomEvent"); |
@@ -635,7 +570,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
635 | newEvent.layerEventLocale = "styles"; | 570 | newEvent.layerEventLocale = "styles"; |
636 | newEvent.layerEventType = "newStyle"; | 571 | newEvent.layerEventType = "newStyle"; |
637 | newEvent.layerID = this.layerID; | 572 | newEvent.layerID = this.layerID; |
638 | newEvent.styleID = this.layerID + "@" + this._styleCounter; | 573 | newEvent.styleIndex = this.styleCounter; |
574 | newEvent.styleID = this.layerID + "@" + this.styleCounter; // is this property needed? | ||
639 | 575 | ||
640 | newStyle.styleID = newEvent.styleID; | 576 | newStyle.styleID = newEvent.styleID; |
641 | newStyle.whichView = "hintable"; | 577 | newStyle.whichView = "hintable"; |
@@ -643,26 +579,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
643 | newStyle.editorValue = ""; | 579 | newStyle.editorValue = ""; |
644 | newStyle.ruleTweener = false; | 580 | newStyle.ruleTweener = false; |
645 | newStyle.isSelected = false; | 581 | newStyle.isSelected = false; |
582 | this.arrLayerStyles.push(newStyle); | ||
646 | 583 | ||
647 | if (!!this.styleRepetition.selectedIndexes) { | ||
648 | mySelection = this.styleRepetition.selectedIndexes[0]; | ||
649 | this.arrLayerStyles.splice(mySelection, 0, newStyle); | ||
650 | //this.styleRepetition.selectedIndexes = [mySelection]; | ||
651 | this.selectStyle(mySelection); | ||
652 | } else { | ||
653 | newLength = this.arrLayerStyles.length; | ||
654 | this.arrLayerStyles.push(newStyle); | ||
655 | mySelection = this.arrLayerStyles.length; | ||
656 | // this.styleRepetition.selectedIndexes = [mySelection-1]; | ||
657 | this.selectStyle(mySelection-1); | ||
658 | } | ||
659 | |||
660 | // Set up the event info and dispatch the event | 584 | // Set up the event info and dispatch the event |
661 | 585 | this.styleCounter += 1; | |
662 | newEvent.styleSelection = mySelection; | 586 | // newEvent.styleSelection = mySelection; |
663 | defaultEventManager.dispatchEvent(newEvent); | 587 | defaultEventManager.dispatchEvent(newEvent); |
664 | |||
665 | |||
666 | } | 588 | } |