From a822b95a035715e21d994f6a4c96c3e784107bea Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 19 Jun 2012 15:34:35 -0700 Subject: LockedElements - Layers Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.html | 8 ++- js/panels/Timeline/Layer.reel/Layer.js | 71 +++++++++++----------- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 35 ++++------- 3 files changed, 54 insertions(+), 60 deletions(-) (limited to 'js') 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 @@ "topControl": {"@" : "dtext_position_y"}, "widthControl": {"@" : "dtext_scale_x"}, "heightControl": {"@" : "dtext_scale_y"}, - "styleType":{"@" : "style"} + "styleType":{"@" : "style"}, + "layerLock":{"#" : "layerLock"}, + "visibilityButton":{"#" : "visibilityButton"} } }, "dtext1" : { @@ -262,8 +264,8 @@ Label -
-
+
+
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, { }, handleLayerLock: { - value: function() { - var i = 0; - var arrlength = this.application.ninja.timeline.arrLayers.length; - var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; - if(!this.layerData.isLock){ - for(i = 0; i < arrlength; i++){ - if(this.application.ninja.timeline.arrLayers[i].layerData.isLock){ - this.application.ninja.timeline.arrLayers[i].layerData.isLock = false; - this.application.ninja.timeline.arrLayers[i].layerData.isSelected = false; - for(var k = 0; k < lockElementArrLength; k++){ - if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.elementsList[0]){ - this.application.ninja.currentDocument.lockedElements.splice(k,1); - break; - } + value: function() { + var i = 0; + var arrlength = this.application.ninja.timeline.arrLayers.length; + var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; + if(!this.layerData.isLock){ + for(i = 0; i < arrlength; i++){ + if(this.application.ninja.timeline.arrLayers[i].layerData.isLock){ + this.application.ninja.timeline.arrLayers[i].layerData.isLock = false; + this.application.ninja.timeline.arrLayers[i].layerData.isSelected = false; + for(var k = 0; k < lockElementArrLength; k++){ + if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){ + this.application.ninja.currentDocument.lockedElements.splice(k,1); + break; } } - } - this.layerData.isSelected = false; - this.application.ninja.timeline.selectLayers([]); - this.application.ninja.currentDocument.lockedElements.push(this.layerData.elementsList[0]); - } else { - this.layerData.isSelected = true; - for(k = 0; k -1) { - this.arrLayers[i].layerData.isSelected = true; - this.arrLayers[i].isSelected = true; - this.triggerLayerBinding(i); - arrSelectedLayers.push(i); - arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement); + if(!this.arrLayers[i].layerData.isLock){ + this.arrLayers[i].layerData.isSelected = true; + this.arrLayers[i].isSelected = true; + this.triggerLayerBinding(i); + arrSelectedLayers.push(i); + arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement); + }else{ + this.arrLayers[i].layerData.isSelected = false; + this.triggerLayerBinding(i); + } } } @@ -1732,8 +1726,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function(event){ var arrLayersLength = this.arrLayers.length; - console.log(this.application.ninja.currentDocument) - debugger; var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; var i = 0; @@ -1767,7 +1759,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleLayerVisibleClick:{ value:function(event){ - var arrLayersLength = this.arrLayers.length; var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; var i = 0; @@ -1776,7 +1767,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { event.currentTarget.classList.remove("checked"); for(i = 0; i < arrLayersLength; i++){ this.arrLayers[i].layerData.isHidden = false; - this.arrLayers[i].layerData.elementsList[0].style.visibility = "visible"; + this.arrLayers[i].layerData.stageElement.style.visibility = "visible"; for(var k=0;k