From 7845d312396e3329ac9246d4c13e99cb623216d5 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 27 Mar 2012 18:22:10 -0700 Subject: Timeline: Stability fixes for drag-and-drop and page switching. --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index cb133f58..a82d3373 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -294,17 +294,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (newVal !== this._dropLayerID) { this._dropLayerID = newVal; - // Create a snapshot of arrLayers so we can manipulate it safely - var arrLayers = this.arrLayers, - dragLayerIndex = this.getLayerIndexByID(this.dragLayerID), + var dragLayerIndex = this.getLayerIndexByID(this.dragLayerID), dropLayerIndex = this.getLayerIndexByID(this.dropLayerID), - dragLayer = arrLayers[dragLayerIndex]; - - arrLayers.splice(dragLayerIndex, 1); - arrLayers.splice(dropLayerIndex, 0, dragLayer); - - // Update the repetition! - this.arrLayers = arrLayers; + dragLayer = this.arrLayers[dragLayerIndex]; + + this.arrLayers.splice(dragLayerIndex, 1); + this.arrLayers.splice(dropLayerIndex, 0, dragLayer); + this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; // Clear for future DnD this._dropLayerID = null; -- cgit v1.2.3