diff options
author | Jon Reid | 2012-06-26 13:49:03 -0700 |
---|---|---|
committer | Jon Reid | 2012-06-26 13:49:03 -0700 |
commit | 9aa987003f0c7866e66aabcc7d9cc2b9da8ed91c (patch) | |
tree | 243f3025361078bcb4aa8fc43641fb5df192838a /js | |
parent | 56b0e02373a60acd58da43f67e52ed3409d74050 (diff) | |
download | ninja-9aa987003f0c7866e66aabcc7d9cc2b9da8ed91c.tar.gz |
Timeline: Bug fix: Indexing on styles when loading files.
Diffstat (limited to 'js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 14 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 14 |
2 files changed, 25 insertions, 3 deletions
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, { | |||
752 | //defaultEventManager.dispatchEvent(newEvent); | 752 | //defaultEventManager.dispatchEvent(newEvent); |
753 | 753 | ||
754 | // Dispatch the event to the TimelineTrack component associated with this Layer. | 754 | // Dispatch the event to the TimelineTrack component associated with this Layer. |
755 | var myIndex = this.application.ninja.timeline.getActiveLayerIndex(), | 755 | var myIndex = false, |
756 | i = 0, | ||
757 | arrLayersLength = this.parentComponent.parentComponent.arrLayers.length, | ||
756 | arrTracks = document.querySelectorAll('[data-montage-id="track"]'); | 758 | arrTracks = document.querySelectorAll('[data-montage-id="track"]'); |
757 | 759 | ||
760 | for (i = 0; i < arrLayersLength; i++) { | ||
761 | if (this.stageElement == this.parentComponent.parentComponent.arrLayers[i].layerData.stageElement) { | ||
762 | myIndex = i; | ||
763 | } | ||
764 | } | ||
765 | |||
758 | if (myIndex !== false) { | 766 | if (myIndex !== false) { |
759 | arrTracks[myIndex].dispatchEvent(newEvent); | 767 | arrTracks[myIndex].dispatchEvent(newEvent); |
760 | } | 768 | } |
761 | } | 769 | } |
762 | }, | 770 | }, |
763 | 771 | ||
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, { | |||
72 | this.trackData.isVisible = value; | 72 | this.trackData.isVisible = value; |
73 | } | 73 | } |
74 | }, | 74 | }, |
75 | |||
76 | _stageElement: { | ||
77 | value: null | ||
78 | }, | ||
79 | stageElement: { | ||
80 | get: function() { | ||
81 | return this._stageElement; | ||
82 | }, | ||
83 | set: function(newVal) { | ||
84 | this._stageElement = newVal; | ||
85 | this.trackData.stageElement = newVal; | ||
86 | } | ||
87 | }, | ||
75 | 88 | ||
76 | // Are the various collapsers collapsed or not | 89 | // Are the various collapsers collapsed or not |
77 | _isMainCollapsed:{ | 90 | _isMainCollapsed:{ |
@@ -484,6 +497,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
484 | this.isStyleCollapsed = this.trackData.isStyleCollapsed; | 497 | this.isStyleCollapsed = this.trackData.isStyleCollapsed; |
485 | this.trackPosition = this.trackData.trackPosition; | 498 | this.trackPosition = this.trackData.trackPosition; |
486 | this.isVisible = this.trackData.isVisible; | 499 | this.isVisible = this.trackData.isVisible; |
500 | this.stageElement = this.trackData.stageElement; | ||
487 | this.trackEditorProperty = "master"; | 501 | this.trackEditorProperty = "master"; |
488 | this.needsDraw = true; | 502 | this.needsDraw = true; |
489 | } | 503 | } |