diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 27 |
1 files changed, 21 insertions, 6 deletions
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, { | |||
184 | 184 | ||
185 | updateLayerScroll:{ | 185 | updateLayerScroll:{ |
186 | value:function(){ | 186 | value:function(){ |
187 | console.log(this.layout_tracks.scrollLeft) | ||
188 | this.user_layers.scrollTop = this.layout_tracks.scrollTop; | 187 | this.user_layers.scrollTop = this.layout_tracks.scrollTop; |
189 | this.layout_markers.scrollLeft = this.layout_tracks.scrollLeft; | 188 | this.layout_markers.scrollLeft = this.layout_tracks.scrollLeft; |
190 | } | 189 | } |
@@ -257,8 +256,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
257 | var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); | 256 | var ptrParent = nj.queryParentSelector(event.target, ".container-layer"); |
258 | if (ptrParent !== false) { | 257 | if (ptrParent !== false) { |
259 | // Why yes, the click was within a layer. But which one? | 258 | // Why yes, the click was within a layer. But which one? |
260 | var strLabel = ptrParent.querySelector(".label-layer .collapsible-label").innerText, | 259 | var myIndex = this.getActiveLayerIndex(); |
261 | myIndex = this.getLayerIndexByName(strLabel); | ||
262 | this.selectLayer(myIndex); | 260 | this.selectLayer(myIndex); |
263 | } | 261 | } |
264 | } | 262 | } |
@@ -345,7 +343,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
345 | thingToPush.isMainCollapsed = true; | 343 | thingToPush.isMainCollapsed = true; |
346 | thingToPush.isPositionCollapsed = true; | 344 | thingToPush.isPositionCollapsed = true; |
347 | thingToPush.isTransformCollapsed = true; | 345 | thingToPush.isTransformCollapsed = true; |
348 | thingToPush.isStyleCollapsed = false; | 346 | thingToPush.isStyleCollapsed = true; |
349 | thingToPush.arrLayerStyles = []; | 347 | thingToPush.arrLayerStyles = []; |
350 | thingToPush.element=[]; | 348 | thingToPush.element=[]; |
351 | thingToPush.deleted=false; | 349 | thingToPush.deleted=false; |
@@ -764,7 +762,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
764 | selectLayer : { | 762 | selectLayer : { |
765 | value: function(layerIndex) { | 763 | value: function(layerIndex) { |
766 | // Select a layer based on its index. | 764 | // Select a layer based on its index. |
767 | // use layerIndex = "none" to deselect all layers. | 765 | // use layerIndex = false to deselect all layers. |
768 | var i = 0, | 766 | var i = 0, |
769 | arrLayersLength = this.arrLayers.length; | 767 | arrLayersLength = this.arrLayers.length; |
770 | 768 | ||
@@ -778,7 +776,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
778 | } | 776 | } |
779 | 777 | ||
780 | // Next, update this.layerRepetition.selectedIndexes and this.currentLayerSelected. | 778 | // Next, update this.layerRepetition.selectedIndexes and this.currentLayerSelected. |
781 | if (layerIndex !== "none") { | 779 | if (layerIndex !== false) { |
782 | this.layerRepetition.selectedIndexes = [layerIndex]; | 780 | this.layerRepetition.selectedIndexes = [layerIndex]; |
783 | this.currentLayerSelected = this.arrLayers[layerIndex] | 781 | this.currentLayerSelected = this.arrLayers[layerIndex] |
784 | } else { | 782 | } else { |
@@ -824,6 +822,23 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
824 | return returnVal; | 822 | return returnVal; |
825 | } | 823 | } |
826 | }, | 824 | }, |
825 | getActiveLayerIndex : { | ||
826 | value: function() { | ||
827 | // Searches through the layers and looks for one that has | ||
828 | // set its isActive flag to true. | ||
829 | var i = 0, | ||
830 | returnVal = false, | ||
831 | arrLayersLength = this.arrLayers.length; | ||
832 | |||
833 | for (i = 0; i < arrLayersLength; i++) { | ||
834 | if (this.arrLayers[i].isActive === true) { | ||
835 | returnVal = i; | ||
836 | this.arrLayers[i].isActive = false; | ||
837 | } | ||
838 | } | ||
839 | return returnVal; | ||
840 | } | ||
841 | }, | ||
827 | 842 | ||
828 | insertLayer: { | 843 | insertLayer: { |
829 | value: function() { | 844 | value: function() { |