From 1f8cb3a25745e5eb07bffccb4f5d5958e595e740 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 15 Jun 2012 17:32:28 -0700 Subject: Timeline: Bug fix: Document switching no longer causes multiple styles to be added. --- js/panels/Timeline/Layer.reel/Layer.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline/Layer.reel') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 4941ff79..0abd97be 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -710,7 +710,15 @@ var Layer = exports.Layer = Montage.create(Component, { // Set up the event info and dispatch the event this.styleCounter += 1; // newEvent.styleSelection = mySelection; - defaultEventManager.dispatchEvent(newEvent); + //defaultEventManager.dispatchEvent(newEvent); + + // Dispatch the event to the TimelineTrack component associated with this Layer. + var myIndex = this.application.ninja.timeline.getActiveLayerIndex(), + arrTracks = document.querySelectorAll('[data-montage-id="track"]'); + + if (myIndex !== false) { + arrTracks[myIndex].dispatchEvent(newEvent); + } } }, @@ -728,8 +736,15 @@ var Layer = exports.Layer = Montage.create(Component, { newEvent.layerID = this.layerID; newEvent.styleID = this.selectedStyleIndex; newEvent.selectedStyleIndex = this.selectedStyleIndex; - defaultEventManager.dispatchEvent(newEvent); - + + // Dispatch the event to the TimelineTrack component associated with this Layer. + var myIndex = this.application.ninja.timeline.getActiveLayerIndex(), + arrTracks = document.querySelectorAll('[data-montage-id="track"]'); + + if (myIndex !== false) { + arrTracks[myIndex].dispatchEvent(newEvent); + } + // Delete the style from the view this.arrLayerStyles.splice(this.selectedStyleIndex, 1); -- cgit v1.2.3