From bd46eee87a4f84871169546c10795678131f9ed9 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 19 Jun 2012 10:56:14 -0700 Subject: Lock Elements Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 106 +++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'js/panels/Timeline/Layer.reel') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 0abd97be..f6d75dca 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -368,6 +368,41 @@ var Layer = exports.Layer = Montage.create(Component, { this.layerData.isVisible = value; } }, + + _isLock:{ + value: false + }, + + isLock:{ + get:function(){ + return this._isLock; + }, + set:function(value){ + if (this._isLock !== value) { + this._isLock = value; + + } + this.layerData.isLock = value; + } + }, + + _isHidden:{ + value: false + }, + + isHidden:{ + get:function(){ + return this._isHidden; + }, + set:function(value){ + if (this._isHidden !== value) { + this._isHidden = value; + + } + this.layerData._isHidden = value; + } + }, + _justAdded: { value: false @@ -1223,6 +1258,77 @@ 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; + } + } + } + } + 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 --- js/panels/Timeline/Layer.reel/Layer.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/panels/Timeline/Layer.reel') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index f6d75dca..970f2b65 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -543,6 +543,8 @@ var Layer = exports.Layer = Montage.create(Component, { this.docUUID = this.layerData.docUUID; this.selectedStyleIndex = this.layerData.selectedStyleIndex; this.needsDraw = boolNeedsDraw; + this.isLock = this.layerData.isLock; + this.isHidden = this.layerData.isHidden; } }, @@ -590,6 +592,8 @@ var Layer = exports.Layer = Montage.create(Component, { this.mainCollapser.clicker.addEventListener("click", this.handleMainCollapserClick.bind(this), false); this.positionCollapser.clicker.addEventListener("click", this.handlePositionCollapserClick.bind(this), false); this.styleCollapser.clicker.addEventListener("click", this.handleStyleCollapserClick.bind(this), false); + this.layerLock.addEventListener("click",this.handleLayerLock.bind(this),false); + this.visibilityButton.addEventListener("click",this.handleLayerVisibility.bind(this),false); // Add event listeners to add and delete style buttons this.buttonAddStyle.addEventListener("click", this.handleAddStyleClick.bind(this), false); -- cgit v1.2.3 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 ++++++++++++++++---------------- 2 files changed, 41 insertions(+), 38 deletions(-) (limited to 'js/panels/Timeline/Layer.reel') 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