diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 5 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 26 |
2 files changed, 26 insertions, 5 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index f7cd40ca..29bf6eb3 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | |||
@@ -98,6 +98,11 @@ | |||
98 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isSelected", | 98 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isSelected", |
99 | "oneway" : false | 99 | "oneway" : false |
100 | }, | 100 | }, |
101 | "isActive" : { | ||
102 | "boundObject" : {"@" : "repetition1"}, | ||
103 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isActive", | ||
104 | "oneway" : false | ||
105 | }, | ||
101 | "isStyleCollapsed" : { | 106 | "isStyleCollapsed" : { |
102 | "boundObject" : {"@" : "repetition1"}, | 107 | "boundObject" : {"@" : "repetition1"}, |
103 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", | 108 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 9904a563..c21fa22b 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -261,8 +261,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
261 | var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); | 261 | var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); |
262 | if (ptrParent !== false) { | 262 | if (ptrParent !== false) { |
263 | // Why yes, the click was within a layer. But which one? | 263 | // Why yes, the click was within a layer. But which one? |
264 | var strLabel = ptrParent.querySelector(".label-layer .collapsible-label").innerText, | 264 | var myIndex = this.getActiveLayerIndex(); |
265 | myIndex = this.getLayerIndexByName(strLabel); | ||
266 | this.selectLayer(myIndex); | 265 | this.selectLayer(myIndex); |
267 | } | 266 | } |
268 | } | 267 | } |
@@ -353,7 +352,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
353 | thingToPush.isMainCollapsed = true; | 352 | thingToPush.isMainCollapsed = true; |
354 | thingToPush.isPositionCollapsed = true; | 353 | thingToPush.isPositionCollapsed = true; |
355 | thingToPush.isTransformCollapsed = true; | 354 | thingToPush.isTransformCollapsed = true; |
356 | thingToPush.isStyleCollapsed = false; | 355 | thingToPush.isStyleCollapsed = true; |
357 | thingToPush.arrLayerStyles = []; | 356 | thingToPush.arrLayerStyles = []; |
358 | thingToPush.element=[]; | 357 | thingToPush.element=[]; |
359 | thingToPush.deleted=false; | 358 | thingToPush.deleted=false; |
@@ -790,7 +789,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
790 | selectLayer : { | 789 | selectLayer : { |
791 | value: function(layerIndex) { | 790 | value: function(layerIndex) { |
792 | // Select a layer based on its index. | 791 | // Select a layer based on its index. |
793 | // use layerIndex = "none" to deselect all layers. | 792 | // use layerIndex = false to deselect all layers. |
794 | var i = 0, | 793 | var i = 0, |
795 | arrLayersLength = this.arrLayers.length; | 794 | arrLayersLength = this.arrLayers.length; |
796 | 795 | ||
@@ -804,7 +803,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
804 | } | 803 | } |
805 | 804 | ||
806 | // Next, update this.layerRepetition.selectedIndexes and this.currentLayerSelected. | 805 | // Next, update this.layerRepetition.selectedIndexes and this.currentLayerSelected. |
807 | if (layerIndex !== "none") { | 806 | if (layerIndex !== false) { |
808 | this.layerRepetition.selectedIndexes = [layerIndex]; | 807 | this.layerRepetition.selectedIndexes = [layerIndex]; |
809 | this.currentLayerSelected = this.arrLayers[layerIndex] | 808 | this.currentLayerSelected = this.arrLayers[layerIndex] |
810 | } else { | 809 | } else { |
@@ -850,6 +849,23 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
850 | return returnVal; | 849 | return returnVal; |
851 | } | 850 | } |
852 | }, | 851 | }, |
852 | getActiveLayerIndex : { | ||
853 | value: function() { | ||
854 | // Searches through the layers and looks for one that has | ||
855 | // set its isActive flag to true. | ||
856 | var i = 0, | ||
857 | returnVal = false, | ||
858 | arrLayersLength = this.arrLayers.length; | ||
859 | |||
860 | for (i = 0; i < arrLayersLength; i++) { | ||
861 | if (this.arrLayers[i].isActive === true) { | ||
862 | returnVal = i; | ||
863 | this.arrLayers[i].isActive = false; | ||
864 | } | ||
865 | } | ||
866 | return returnVal; | ||
867 | } | ||
868 | }, | ||
853 | 869 | ||
854 | insertLayer: { | 870 | insertLayer: { |
855 | value: function() { | 871 | value: function() { |