From a8c16ca440b8ded3b78b59c767539e8c080680e7 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 8 Feb 2012 16:12:58 -0800 Subject: Squashed commit of the following: commit 46292bddbfbe7415c6852142dd10fd02a276722a Author: Jon Reid Date: Wed Feb 8 14:32:22 2012 -0800 Timeline: turn off console logging. commit b8de88393182bc6e819c3d6a290ade2f804236ac Merge: e651344 37b952c Author: Jon Reid Date: Wed Feb 8 14:10:06 2012 -0800 Merge branch 'Timeline-jduran' into Timeline-jreid commit e651344d5d6c2911b31a54510c65a349c4d52db2 Author: Jon Reid Date: Wed Feb 8 14:08:25 2012 -0800 Timeline: Bug fixes IKNINJA-947: Weird behavior with adding layers with an empty layer name selected IKNINJA-990: Multiple styles can be highlighted at the same time even when they are under different layers IKNINJA-1063: Styles can be added while style column is collapsed IKNINJA-970: When there is no style added yet, the arrow sign should be in a collapsed mode Signed-off-by: Jonathan Duran --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 8f7c63bf..f56eaf74 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -184,7 +184,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { updateLayerScroll:{ value:function(){ - console.log(this.layout_tracks.scrollLeft) this.user_layers.scrollTop = this.layout_tracks.scrollTop; this.layout_markers.scrollLeft = this.layout_tracks.scrollLeft; } @@ -257,8 +256,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); if (ptrParent !== false) { // Why yes, the click was within a layer. But which one? - var strLabel = ptrParent.querySelector(".label-layer .collapsible-label").innerText, - myIndex = this.getLayerIndexByName(strLabel); + var myIndex = this.getActiveLayerIndex(); this.selectLayer(myIndex); } } @@ -345,7 +343,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.isMainCollapsed = true; thingToPush.isPositionCollapsed = true; thingToPush.isTransformCollapsed = true; - thingToPush.isStyleCollapsed = false; + thingToPush.isStyleCollapsed = true; thingToPush.arrLayerStyles = []; thingToPush.element=[]; thingToPush.deleted=false; @@ -764,7 +762,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { selectLayer : { value: function(layerIndex) { // Select a layer based on its index. - // use layerIndex = "none" to deselect all layers. + // use layerIndex = false to deselect all layers. var i = 0, arrLayersLength = this.arrLayers.length; @@ -778,7 +776,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } // Next, update this.layerRepetition.selectedIndexes and this.currentLayerSelected. - if (layerIndex !== "none") { + if (layerIndex !== false) { this.layerRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex] } else { @@ -824,6 +822,23 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { return returnVal; } }, + getActiveLayerIndex : { + value: function() { + // Searches through the layers and looks for one that has + // set its isActive flag to true. + var i = 0, + returnVal = false, + arrLayersLength = this.arrLayers.length; + + for (i = 0; i < arrLayersLength; i++) { + if (this.arrLayers[i].isActive === true) { + returnVal = i; + this.arrLayers[i].isActive = false; + } + } + return returnVal; + } + }, insertLayer: { value: function() { -- cgit v1.2.3