aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/element-controller.js2
-rwxr-xr-xjs/mediators/element-mediator.js4
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js31
-rw-r--r--js/panels/Timeline/Layer.reel/css/Layer.css75
-rw-r--r--js/panels/Timeline/Layer.reel/scss/Layer.scss5
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js690
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js16
7 files changed, 610 insertions, 213 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 20225c61..eecf319e 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -17,7 +17,7 @@ exports.ElementController = Montage.create(Component, {
17 if(selectedLayerIndex === 0) { 17 if(selectedLayerIndex === 0) {
18 this.application.ninja.currentSelectedContainer.appendChild(el); 18 this.application.ninja.currentSelectedContainer.appendChild(el);
19 } else { 19 } else {
20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; 20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.stageElement;
21 element.parentNode.insertBefore(el, element.nextSibling); 21 element.parentNode.insertBefore(el, element.nextSibling);
22 } 22 }
23 } else { 23 } else {
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 06514076..9c8a9ac4 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -524,9 +524,9 @@ exports.ElementMediator = Montage.create(Component, {
524 length = layersDraggedArray.length; 524 length = layersDraggedArray.length;
525 525
526 for(var i=0; documentRoot.children[i]; i++) { 526 for(var i=0; documentRoot.children[i]; i++) {
527 if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { 527 if(documentRoot.children[i] === layerDroppedAfter.layerData.stageElement) {
528 if(length >0){ 528 if(length >0){
529 documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); 529 documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.stageElement, documentRoot.children[i]);
530 } 530 }
531 531
532 /* Will require for Multiple Drag n Drop */ 532 /* Will require for Multiple Drag n Drop */
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 }
diff --git a/js/panels/Timeline/Layer.reel/css/Layer.css b/js/panels/Timeline/Layer.reel/css/Layer.css
index 3648fda5..788a786e 100644
--- a/js/panels/Timeline/Layer.reel/css/Layer.css
+++ b/js/panels/Timeline/Layer.reel/css/Layer.css
@@ -71,26 +71,27 @@
71} 71}
72 72
73/******************************************/ 73/******************************************/
74/* line 77, ../scss/Layer.scss */ 74/* line 78, ../scss/Layer.scss */
75.container-layer { 75.container-layer,
76.container-layer.selected {
76 background-color: #474747; 77 background-color: #474747;
77 color: white; 78 color: white;
78 font-size: 12px; 79 font-size: 12px;
79 text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); 80 text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
80} 81}
81 82
82/* line 83, ../scss/Layer.scss */ 83/* line 84, ../scss/Layer.scss */
83.selected .container-layer { 84.selected .container-layer {
84 background-color: #474747; 85 background-color: #474747;
85} 86}
86 87
87/* line 86, ../scss/Layer.scss */ 88/* line 87, ../scss/Layer.scss */
88.selected .container-layer .label-layer { 89.selected .container-layer .label-layer {
89 background-color: #b2b2b2; 90 background-color: #b2b2b2;
90 color: #242424; 91 color: #242424;
91} 92}
92 93
93/* line 91, ../scss/Layer.scss */ 94/* line 92, ../scss/Layer.scss */
94.userlayers .collapsible-label { 95.userlayers .collapsible-label {
95 display: block; 96 display: block;
96 height: 21px; 97 height: 21px;
@@ -103,32 +104,32 @@
103 text-overflow: ellipsis; 104 text-overflow: ellipsis;
104} 105}
105 106
106/* line 103, ../scss/Layer.scss */ 107/* line 104, ../scss/Layer.scss */
107.userlayers .layer-tag { 108.userlayers .layer-tag {
108 position: absolute; 109 position: absolute;
109 top: 3px; 110 top: 3px;
110 left: 20px; 111 left: 20px;
111} 112}
112 113
113/* line 110, ../scss/Layer.scss */ 114/* line 111, ../scss/Layer.scss */
114.layerSelected .label-layer { 115.layerSelected .label-layer {
115 background-color: #b2b2b2; 116 background-color: #b2b2b2;
116 color: #242424; 117 color: #242424;
117} 118}
118 119
119/* line 114, ../scss/Layer.scss */ 120/* line 115, ../scss/Layer.scss */
120.content-layer { 121.content-layer {
121 background-color: #474747; 122 background-color: #474747;
122 color: white; 123 color: white;
123} 124}
124 125
125/* line 118, ../scss/Layer.scss */ 126/* line 119, ../scss/Layer.scss */
126.content-layer .collapsible-label { 127.content-layer .collapsible-label {
127 background-position: 14px 5px; 128 background-position: 14px 5px;
128 border-width: 0px; 129 border-width: 0px;
129} 130}
130 131
131/* line 126, ../scss/Layer.scss */ 132/* line 127, ../scss/Layer.scss */
132.label-layer, 133.label-layer,
133.label-position, 134.label-position,
134.label-transform, 135.label-transform,
@@ -139,20 +140,20 @@
139 cursor: pointer; 140 cursor: pointer;
140} 141}
141 142
142/* line 134, ../scss/Layer.scss */ 143/* line 135, ../scss/Layer.scss */
143.content-layer .collapsible-label, 144.content-layer .collapsible-label,
144.content-layer .collapsible-content, 145.content-layer .collapsible-content,
145.content-layer .layer-tag { 146.content-layer .layer-tag {
146 font-size: 11px; 147 font-size: 11px;
147} 148}
148 149<