From 595a569cf459e7e7cbe19e546c23322b56e44341 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 16 Mar 2012 16:38:42 -0700 Subject: Fix layer order and selection on reopen Layer order should be in the same order as created. Nothing should be selected with opening a doc. Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 21ecdc39..fd297fd3 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -381,9 +381,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._openDoc = true; this.restoreLayer(this.application.ninja.currentDocument.documentRoot.children[myIndex]); } - // select the first layer - this.temparrLayers[0].layerData.isSelected = true; - this.temparrLayers[0].layerData._isFirstDraw = true; } // Feed the new array of objects into the repetitions. this.arrLayers = this.temparrLayers; @@ -666,7 +663,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (this._hashFind) { for (layerResult = this.returnedObject[hashIndex]; layerResult; hashIndex++) { if (layerResult.layerData.deleted !== true) { - this.arrLayers.push(layerResult); + this.arrLayers.splice(0, 0, layerResult); } } @@ -686,7 +683,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.layerData.elementsList.push(ele); } - this.temparrLayers.push(thingToPush); + this.temparrLayers.splice(0, 0, thingToPush); thingToPush.layerData.trackPosition = this.temparrLayers.length - 1; thingToPush.layerData.layerPosition = this.temparrLayers.length - 1; -- cgit v1.2.3