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.js48
1 files changed, 22 insertions, 26 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 36c77018..5b1ce594 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,
@@ -555,10 +566,15 @@ var Layer = exports.Layer = Montage.create(Component, {
555 }, 566 },
556 didDraw: { 567 didDraw: {
557 value: function() { 568 value: function() {
558 if ((this.isSelected === true) && (this._isFirstDraw === true)) { 569 if (this._isFirstDraw === true) {
559 // Once we're done drawing the first time we need to tell the TimelinePanel if 570 if (this.isSelected === true) {
560 // this layer is supposed to be selected. 571 if (this.application.ninja.currentDocument._uuid === this._docUUID) {
561 this.parentComponent.parentComponent.selectedLayerID = this.layerID; 572 // Once we're done drawing the first time we need to tell the TimelinePanel if
573 // this layer is supposed to be selected.
574 //console.log('layerName ' + this.layerName);
575 this.parentComponent.parentComponent.selectedLayerID = this.layerID;
576 }
577 }
562 this._isFirstDraw = false; 578 this._isFirstDraw = false;
563 } 579 }
564 } 580 }
@@ -567,36 +583,16 @@ var Layer = exports.Layer = Montage.create(Component, {
567 583
568 /* Begin: Controllers */ 584 /* Begin: Controllers */
569 585
570 // Initialize a just-created layer with some basic defaults and needed selectors. 586 // Initialize a just-created layer
571 init: { 587 init: {
572 value: function() { 588 value: function() {
573 // Default some vars
574 //this.arrLayerStyles = [];
575
576 // Get some selectors. 589 // Get some selectors.
577 this.label = this.element.querySelector(".label-layer"); 590 this.label = this.element.querySelector(".label-layer");
578 this.titleSelector = this.label.querySelector(".collapsible-label"); 591 this.titleSelector = this.label.querySelector(".collapsible-label");
579 this.buttonAddStyle = this.element.querySelector(".button-add"); 592 this.buttonAddStyle = this.element.querySelector(".button-add");
580 this.buttonDeleteStyle = this.element.querySelector(".button-delete"); 593 this.buttonDeleteStyle = this.element.querySelector(".button-delete");
581
582
583
584 } 594 }
585 }, 595 },
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 : { 596 addStyle : {
601 value: function() { 597 value: function() {
602 // Add a new style rule. It should be added above the currently selected rule, 598 // Add a new style rule. It should be added above the currently selected rule,