aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html8
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js71
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js35
3 files changed, 54 insertions, 60 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html
index 3648cbbb..5ee50491 100644
--- a/js/panels/Timeline/Layer.reel/Layer.html
+++ b/js/panels/Timeline/Layer.reel/Layer.html
@@ -27,7 +27,9 @@
27 "topControl": {"@" : "dtext_position_y"}, 27 "topControl": {"@" : "dtext_position_y"},
28 "widthControl": {"@" : "dtext_scale_x"}, 28 "widthControl": {"@" : "dtext_scale_x"},
29 "heightControl": {"@" : "dtext_scale_y"}, 29 "heightControl": {"@" : "dtext_scale_y"},
30 "styleType":{"@" : "style"} 30 "styleType":{"@" : "style"},
31 "layerLock":{"#" : "layerLock"},
32 "visibilityButton":{"#" : "visibilityButton"}
31 } 33 }
32 }, 34 },
33 "dtext1" : { 35 "dtext1" : {
@@ -262,8 +264,8 @@
262 <span data-montage-id="layer-tag" class="layer-tag"></span> 264 <span data-montage-id="layer-tag" class="layer-tag"></span>
263 <span class="collapsible-label" data-montage-id="layer-label-text" spellcheck="false">Label</span> 265 <span class="collapsible-label" data-montage-id="layer-label-text" spellcheck="false">Label</span>
264 <span class="collapsible-clicker collapsible-collapsed" data-montage-id="clicker-main"></span> 266 <span class="collapsible-clicker collapsible-collapsed" data-montage-id="clicker-main"></span>
265 <div class="cssbutton button-lock"></div> 267 <div class="cssbutton button-lock" data-montage-id="layerLock"></div>
266 <div class="cssbutton button-visible"></div> 268 <div class="cssbutton button-visible" data-montage-id="visibilityButton"></div>
267 </div> 269 </div>
268 <div class="collapsible-content content-layer collapsible-collapsed" data-montage-id="content-main"> 270 <div class="collapsible-content content-layer collapsible-collapsed" data-montage-id="content-main">
269 <div class="label-position"> 271 <div class="label-position">
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 970f2b65..776d5ec8 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -1263,39 +1263,40 @@ var Layer = exports.Layer = Montage.create(Component, {
1263 }, 1263 },
1264 1264
1265 handleLayerLock: { 1265 handleLayerLock: {
1266 value: function() { 1266 value: function() {
1267 var i = 0; 1267 var i = 0;
1268 var arrlength = this.application.ninja.timeline.arrLayers.length; 1268 var arrlength = this.application.ninja.timeline.arrLayers.length;
1269 var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; 1269 var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length;
1270 if(!this.layerData.isLock){ 1270 if(!this.layerData.isLock){
1271 for(i = 0; i < arrlength; i++){ 1271 for(i = 0; i < arrlength; i++){
1272 if(this.application.ninja.timeline.arrLayers[i].layerData.isLock){ 1272 if(this.application.ninja.timeline.arrLayers[i].layerData.isLock){
1273 this.application.ninja.timeline.arrLayers[i].layerData.isLock = false; 1273 this.application.ninja.timeline.arrLayers[i].layerData.isLock = false;
1274 this.application.ninja.timeline.arrLayers[i].layerData.isSelected = false; 1274 this.application.ninja.timeline.arrLayers[i].layerData.isSelected = false;
1275 for(var k = 0; k < lockElementArrLength; k++){ 1275 for(var k = 0; k < lockElementArrLength; k++){
1276 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.elementsList[0]){ 1276 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){
1277 this.application.ninja.currentDocument.lockedElements.splice(k,1); 1277 this.application.ninja.currentDocument.lockedElements.splice(k,1);
1278 break; 1278 break;
1279 }
1280 } 1279 }
1281 } 1280 }
1282 } 1281 }
1283 this.layerData.isSelected = false; 1282 }
1284 this.application.ninja.timeline.selectLayers([]); 1283 this.layerData.isSelected = false;
1285 this.application.ninja.currentDocument.lockedElements.push(this.layerData.elementsList[0]); 1284 this.application.ninja.timeline.selectLayers([]);
1286 } else { 1285 this.application.ninja.currentDocument.lockedElements.push(this.layerData.stageElement);
1287 this.layerData.isSelected = true; 1286 } else {
1288 for(k = 0; k<lockElementArrLength; k++){ 1287 this.layerData.isSelected = true;
1289 if(this.application.ninja.currentDocument.lockedElements[k] === this.layerData.elementsList[0]){ 1288 for(k = 0; k<lockElementArrLength; k++){
1290 this.application.ninja.currentDocument.lockedElements.splice(k,1); 1289 if(this.application.ninja.currentDocument.lockedElements[k] === this.layerData.stageElement){
1291 break; 1290 this.application.ninja.currentDocument.lockedElements.splice(k,1);
1292 } 1291 break;
1293 } 1292 }
1294 } 1293 }
1295 this.layerData.isLock = !this.layerData.isLock;
1296 1294
1297 } 1295 }
1298 }, 1296 this.layerData.isLock = !this.layerData.isLock;
1297
1298 }
1299 },
1299 1300
1300 handleLayerVisibility:{ 1301 handleLayerVisibility:{
1301 value:function(){ 1302 value:function(){
@@ -1306,9 +1307,9 @@ var Layer = exports.Layer = Montage.create(Component, {
1306 for(i = 0; i<arrlength; i++){ 1307 for(i = 0; i<arrlength; i++){
1307 if(this.application.ninja.timeline.arrLayers[i].layerData.isHidden){ 1308 if(this.application.ninja.timeline.arrLayers[i].layerData.isHidden){
1308 this.application.ninja.timeline.arrLayers[i].layerData.isHidden = false; 1309 this.application.ninja.timeline.arrLayers[i].layerData.isHidden = false;
1309 this.application.ninja.timeline.arrLayers[i].layerData.elementsList[0].style.visibility = "visible"; 1310 this.application.ninja.timeline.arrLayers[i].layerData.stageElement.style.visibility = "visible";
1310 for(var k = 0;k < lockElementArrLength;k++){ 1311 for(var k = 0;k < lockElementArrLength;k++){
1311 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.elementsList[0]){ 1312 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){
1312 this.application.ninja.currentDocument.lockedElements.splice(k,1); 1313 this.application.ninja.currentDocument.lockedElements.splice(k,1);
1313 break; 1314 break;
1314 } 1315 }
@@ -1316,13 +1317,13 @@ var Layer = exports.Layer = Montage.create(Component, {
1316 } 1317 }
1317 1318
1318 } 1319 }
1319 this.layerData.elementsList[0].style.visibility = "hidden"; 1320 this.layerData.stageElement.style.visibility = "hidden";
1320 this.application.ninja.currentDocument.lockedElements.push(this.layerData.elementsList[0]); 1321 this.application.ninja.currentDocument.lockedElements.push(this.layerData.stageElement);
1321 1322
1322 } else { 1323 } else {
1323 this.layerData.elementsList[0].style.visibility = "visible"; 1324 this.layerData.stageElement.style.visibility = "visible";
1324 for(var k = 0; k < lockElementArrLength; k++){ 1325 for(var k = 0; k < lockElementArrLength; k++){
1325 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.elementsList[0]){ 1326 if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){
1326 this.application.ninja.currentDocument.lockedElements.splice(k,1); 1327 this.application.ninja.currentDocument.lockedElements.splice(k,1);
1327 break; 1328 break;
1328 } 1329 }
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 87e7bd2e..3b6db82e 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -732,6 +732,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
732 this.application.ninja.currentDocument.tlCurrentLayerSelected = false; 732 this.application.ninja.currentDocument.tlCurrentLayerSelected = false;
733 this.application.ninja.currentDocument.tlCurrentLayersSelected = false; 733 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
734 this.application.ninja.currentDocument.tlCurrentElementsSelected = []; 734 this.application.ninja.currentDocument.tlCurrentElementsSelected = [];
735 this.application.ninja.currentDocument.lockedElements = [];
735 } 736 }
736 }, 737 },
737 738
@@ -1119,20 +1120,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1119 1120
1120 // Deselect selected layers if they're not in arrSelectedIndexes. 1121 // Deselect selected layers if they're not in arrSelectedIndexes.
1121 for (i = 0; i < arrLayersLength; i++) { 1122 for (i = 0; i < arrLayersLength; i++) {
1122
1123 debugger;
1124 if([i]===arrSelectedIndexes){
1125 if(this.arrLayers[i].layerData.isLock){
1126 this.arrLayers[i].layerData.isSelected = false;
1127 }else{
1128 this.arrLayers[i].layerData.isSelected = true;
1129 }
1130 }else{
1131 this.arrLayers[i].layerData.isSelected = false;
1132 }
1133 if (this.arrLayers[i].layerData.isSelected === true) { 1123 if (this.arrLayers[i].layerData.isSelected === true) {
1134 if (arrSelectedIndexes.indexOf(i) < 0) { 1124 if (arrSelectedIndexes.indexOf(i) < 0) {
1135
1136 this.arrLayers[i].layerData.isSelected = false; 1125 this.arrLayers[i].layerData.isSelected = false;
1137 this.triggerLayerBinding(i); 1126 this.triggerLayerBinding(i);
1138 } 1127 }
@@ -1150,11 +1139,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1150 // Loop through arrLayers and do the selection. 1139 // Loop through arrLayers and do the selection.
1151 for (i = 0; i < arrLayersLength; i++) { 1140 for (i = 0; i < arrLayersLength; i++) {
1152 if (arrSelectedIndexes.indexOf(i) > -1) { 1141 if (arrSelectedIndexes.indexOf(i) > -1) {
1153 this.arrLayers[i].layerData.isSelected = true; 1142 if(!this.arrLayers[i].layerData.isLock){
1154 this.arrLayers[i].isSelected = true; 1143 this.arrLayers[i].layerData.isSelected = true;
1155 this.triggerLayerBinding(i); 1144 this.arrLayers[i].isSelected = true;
1156 arrSelectedLayers.push(i); 1145 this.triggerLayerBinding(i);
1157 arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement); 1146 arrSelectedLayers.push(i);
1147 arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement);
1148 }else{
1149 this.arrLayers[i].layerData.isSelected = false;
1150 this.triggerLayerBinding(i);
1151 }
1158 } 1152 }
1159 } 1153 }
1160 1154
@@ -1732,8 +1726,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1732 value:function(event){ 1726 value:function(event){