From 4046fca0daee6e064ee5c67bd0826ac42af7718d Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Tue, 19 Jun 2012 10:12:49 -0700 Subject: Locked Elements. Layer Controls Signed-off-by: Kruti Shah --- .../Timeline/TimelinePanel.reel/TimelinePanel.html | 6 +- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 76 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 9e2bacd5..eac361a8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html @@ -35,7 +35,9 @@ "container_tracks" : {"#" : "container-tracks"}, "timeline_disabler" : {"#" : "timeline-disabler"}, "checkable_animated" : {"#" : "checkable_animated"}, - "tl_configbutton" : {"#" : "tl-configbutton"} + "tl_configbutton" : {"#" : "tl-configbutton"}, + "checkable_lock" : {"#" : "checkable_lock"}, + "checkable_visible":{"#" : "checkable_visible"} } }, @@ -178,6 +180,8 @@
Show only animated layers
+
Lock Layers
+
Visibility of Layers
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 339ca5a4..1ef57b13 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -580,6 +580,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Bind the handlers for the config menu this.checkable_animated.addEventListener("click", this.handleAnimatedClick.bind(this), false); this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); + this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); + this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); document.addEventListener("click", this.handleDocumentClick.bind(this), false); this.addPropertyChangeListener("currentDocument.model.domContainer", this); @@ -1395,6 +1397,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.layerData._isFirstDraw = true; thingToPush.layerData.created = true; thingToPush.layerData.stageElement = object; + thingToPush.layerData.isLock = false; + thingToPush.layerData.isHidden = false; + if (this.checkable_animated.classList.contains("checked")) { thingToPush.layerData.isVisible = false; @@ -1712,6 +1717,77 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + handleLockLayerClick:{ + 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; + + if(event.currentTarget.classList.contains("checked")){ + event.currentTarget.classList.remove("checked"); + for(i=0;i