aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Layer.reel/Layer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js49
1 files changed, 23 insertions, 26 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 36c77018..1b8d73c0 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -113,7 +113,18 @@ var Layer = exports.Layer = Montage.create(Component, {
113 this.layerData.layerTag = newVal; 113 this.layerData.layerTag = newVal;
114 } 114 }
115 }, 115 },
116 116 _docUUID : {
117 value: null
118 },
119 docUUID : {
120 serializable: true,
121 get: function() {
122 return this._docUUID;
123 },
124 set: function(newVal) {
125 this._docUUID = newVal;
126 }
127 },
117 /* Position and Transform hottext values */ 128 /* Position and Transform hottext values */
118 _dtextPositionX : { 129 _dtextPositionX : {
119 value:null, 130 value:null,
@@ -471,6 +482,7 @@ var Layer = exports.Layer = Montage.create(Component, {
471 this.layerTag = this.layerData.layerTag; 482 this.layerTag = this.layerData.layerTag;
472 this.isVisible = this.layerData.isVisible; 483 this.isVisible = this.layerData.isVisible;
473 this.isAnimated = this.layerData.isAnimated; 484 this.isAnimated = this.layerData.isAnimated;
485 this.docUUID = this.layerData.docUUID;
474 this.needsDraw = boolNeedsDraw; 486 this.needsDraw = boolNeedsDraw;
475 } 487 }
476 }, 488 },
@@ -555,10 +567,15 @@ var Layer = exports.Layer = Montage.create(Component, {
555 }, 567 },
556 didDraw: { 568 didDraw: {
557 value: function() { 569 value: function() {
558 if ((this.isSelected === true) && (this._isFirstDraw === true)) { 570 if (this._isFirstDraw === true) {
559 // Once we're done drawing the first time we need to tell the TimelinePanel if 571 if (this.isSelected === true) {
560 // this layer is supposed to be selected. 572 if (this.application.ninja.currentDocument._uuid === this._docUUID) {
561 this.parentComponent.parentComponent.selectedLayerID = this.layerID; 573 // Once we're done drawing the first time we need to tell the TimelinePanel if
574 // this layer is supposed to be selected.
575 //console.log('layerName ' + this.layerName);
576 this.parentComponent.parentComponent.selectedLayerID = this.layerID;
577 }
578 }
562 this._isFirstDraw = false; 579 this._isFirstDraw = false;
563 } 580 }
564 } 581 }
@@ -567,36 +584,16 @@ var Layer = exports.Layer = Montage.create(Component, {
567 584
568 /* Begin: Controllers */ 585 /* Begin: Controllers */
569 586
570 // Initialize a just-created layer with some basic defaults and needed selectors. 587 // Initialize a just-created layer
571 init: { 588 init: {
572 value: function() { 589 value: function() {
573 // Default some vars
574 //this.arrLayerStyles = [];
575
576 // Get some selectors. 590 // Get some selectors.
577 this.label = this.element.querySelector(".label-layer"); 591 this.label = this.element.querySelector(".label-layer");
578 this.titleSelector = this.label.querySelector(".collapsible-label"); 592 this.titleSelector = this.label.querySelector(".collapsible-label");
579 this.buttonAddStyle = this.element.querySelector(".button-add"); 593 this.buttonAddStyle = this.element.querySelector(".button-add");
580 this.buttonDeleteStyle = this.element.querySelector(".button-delete"); 594 this.buttonDeleteStyle = this.element.querySelector(".button-delete");
581
582
583
584 } 595 }
585 }, 596 },
586 selectLayer:{
587 value:function(){
588 // this.mainCollapser.header.classList.add("layerSelected");
589 this.element.classList.add("layerSelected");
590 this.isSelected = true;
591 }
592 },
593 deselectLayer:{
594 value:function(){
595 // this.mainCollapser.header.classList.remove("layerSelected");
596 this.element.classList.remove("layerSelected");
597 this.isSelected = false;
598 }
599 },
600 addStyle : { 597 addStyle : {
601 value: function() { 598 value: function() {
602 // Add a new style rule. It should be added above the currently selected rule, 599 // Add a new style rule. It should be added above the currently selected rule,