From 9aa987003f0c7866e66aabcc7d9cc2b9da8ed91c Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 13:49:03 -0700 Subject: Timeline: Bug fix: Indexing on styles when loading files. --- js/panels/Timeline/Layer.reel/Layer.js | 14 +++++++++++--- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index a8c22b2a..2deb20da 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -752,12 +752,20 @@ var Layer = exports.Layer = Montage.create(Component, { //defaultEventManager.dispatchEvent(newEvent); // Dispatch the event to the TimelineTrack component associated with this Layer. - var myIndex = this.application.ninja.timeline.getActiveLayerIndex(), + var myIndex = false, + i = 0, + arrLayersLength = this.parentComponent.parentComponent.arrLayers.length, arrTracks = document.querySelectorAll('[data-montage-id="track"]'); - + + for (i = 0; i < arrLayersLength; i++) { + if (this.stageElement == this.parentComponent.parentComponent.arrLayers[i].layerData.stageElement) { + myIndex = i; + } + } + if (myIndex !== false) { arrTracks[myIndex].dispatchEvent(newEvent); - } + } } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 98989022..d4eabbf5 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -72,6 +72,19 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.trackData.isVisible = value; } }, + + _stageElement: { + value: null + }, + stageElement: { + get: function() { + return this._stageElement; + }, + set: function(newVal) { + this._stageElement = newVal; + this.trackData.stageElement = newVal; + } + }, // Are the various collapsers collapsed or not _isMainCollapsed:{ @@ -484,6 +497,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.isStyleCollapsed = this.trackData.isStyleCollapsed; this.trackPosition = this.trackData.trackPosition; this.isVisible = this.trackData.isVisible; + this.stageElement = this.trackData.stageElement; this.trackEditorProperty = "master"; this.needsDraw = true; } -- cgit v1.2.3