diff options
author | Kruti Shah | 2012-06-19 15:34:35 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-19 15:34:35 -0700 |
commit | a822b95a035715e21d994f6a4c96c3e784107bea (patch) | |
tree | b6e6236ea19aacb01e519908c2f1de9d8d5ea0a2 /js/panels/Timeline/Layer.reel/Layer.js | |
parent | e31c80f4162485ff7ac213609a6640c5fba4873e (diff) | |
download | ninja-a822b95a035715e21d994f6a4c96c3e784107bea.tar.gz |
LockedElements - Layers
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 71 |
1 files changed, 36 insertions, 35 deletions
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 | } |