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.js31
1 files changed, 25 insertions, 6 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b0f6d220..4a737490 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -133,6 +133,20 @@ var Layer = exports.Layer = Montage.create(Component, {
133 } 133 }
134 }, 134 },
135 135
136 _stageElement: {
137 value: null
138 },
139
140 stageElement: {
141 get: function() {
142 return this._stageElement;
143 },
144 set: function(newVal) {
145 this._stageElement = newVal;
146 this.layerData.stageElement = newVal;
147 }
148 },
149
136 150
137 _elementsList : { 151 _elementsList : {
138 value: [] 152 value: []
@@ -398,6 +412,7 @@ var Layer = exports.Layer = Montage.create(Component, {
398 412
399 this.layerName = this.layerData.layerName; 413 this.layerName = this.layerData.layerName;
400 this.layerID = this.layerData.layerID; 414 this.layerID = this.layerData.layerID;
415 this.stageElement = this.layerData.stageElement
401 this.arrLayerStyles = this.layerData.arrLayerStyles; 416 this.arrLayerStyles = this.layerData.arrLayerStyles;
402 this.isMainCollapsed = this.layerData.isMainCollapsed; 417 this.isMainCollapsed = this.layerData.isMainCollapsed;
403 this.isPositionCollapsed = this.layerData.isPositionCollapsed; 418 this.isPositionCollapsed = this.layerData.isPositionCollapsed;
@@ -494,10 +509,14 @@ var Layer = exports.Layer = Montage.create(Component, {
494 }, 509 },
495 draw: { 510 draw: {
496 value: function() { 511 value: function() {
497 if (this.isSelected) { 512 var boolHasClass = this.element.classList.contains("layerSelected");
498 this.element.classList.add("selected"); 513 if (this.isSelected && !boolHasClass) {
499 } else { 514 //console.log('Layer.draw, adding selection for layer ', this.layerName)
500 this.element.classList.remove("selected"); 515 this.element.classList.add("layerSelected");
516 }
517 if (!this.isSelected && boolHasClass) {
518 //console.log('Layer.draw, removing selection for layer ', this.layerName)
519 this.element.classList.remove("layerSelected");
501 } 520 }
502 } 521 }
503 }, 522 },
@@ -674,7 +693,7 @@ var Layer = exports.Layer = Montage.create(Component, {
674 this.dynamicLayerName.value = this._layerEditable.value; 693 this.dynamicLayerName.value = this._layerEditable.value;
675 this.needsDraw = true; 694 this.needsDraw = true;
676 this.application.ninja.documentController.activeDocument.needsSave = true; 695 this.application.ninja.documentController.activeDocument.needsSave = true;
677 this.layerData.elementsList[0].setAttribute("id",this.dynamicLayerName.value); 696 this.layerData.stageElement.setAttribute("id",this.dynamicLayerName.value);
678 } 697 }
679 }, 698 },
680 handleAddStyleClick: { 699 handleAddStyleClick: {
@@ -786,7 +805,7 @@ var Layer = exports.Layer = Montage.create(Component, {
786 }, 805 },
787 handleDragstart: { 806 handleDragstart: {
788 value: function(event) { 807 value: function(event) {
789 this.parentComponent.parentComponent.dragLayerID = this.layerID; 808 //this.parentComponent.parentComponent.dragLayerID = this.layerID;
790 event.dataTransfer.setData('Text', 'Layer'); 809 event.dataTransfer.setData('Text', 'Layer');
791 this.parentComponent.parentComponent.draggingType = "layer"; 810 this.parentComponent.parentComponent.draggingType = "layer";
792 } 811 }