diff options
author | Jon Reid | 2012-06-21 18:01:39 -0700 |
---|---|---|
committer | Jon Reid | 2012-06-21 18:01:39 -0700 |
commit | fff4cd20a23b95519333daec564f309be7d7d4ec (patch) | |
tree | 7607551bee9f570610895bafff2d6ab606377d1e | |
parent | b154a6e287dcc2aec57e49ca569ee8004675eb42 (diff) | |
download | ninja-fff4cd20a23b95519333daec564f309be7d7d4ec.tar.gz |
Timeline: Bug fix: When creating a new file, Timeline was disabled.
(Injection from fix of IKNINJA-1783)
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 96be66e8..0d0be721 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -117,36 +117,42 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
117 | if (value === this._currentDocument) { | 117 | if (value === this._currentDocument) { |
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | 120 | this._currentDocument = value; | |
121 | |||
122 | var boolDoc = false, | ||
123 | boolView = false; | ||
124 | |||
121 | // Should we enable the panel? | 125 | // Should we enable the panel? |
126 | // Only if we have both a document and we're in design view. | ||
127 | if (typeof(value) !== "undefined") { | ||
128 | if (value.currentView === "design") { | ||
129 | // We are in design view. | ||
130 | boolView = true; | ||
131 | } | ||
132 | } | ||
122 | if (typeof(this._currentDocument) !== "undefined") { | 133 | if (typeof(this._currentDocument) !== "undefined") { |
123 | // We have a document, or at least we have initialized the panel. | 134 | // We have a document, or at least we have initialized the panel. |
124 | // What view are we in? | 135 | boolDoc = true; |
125 | if (typeof(value) !== "undefined") { | ||
126 | if (value.currentView === "design") { | ||
127 | // We are in design view, so enable the panel. | ||
128 | this.enablePanel(true); | ||
129 | } | ||
130 | } | ||
131 | } | 136 | } |
132 | 137 | ||
133 | this._currentDocument = value; | 138 | if(boolDoc === false) { |
134 | |||
135 | if(!value) { | ||
136 | this._boolCacheArrays = false; | 139 | this._boolCacheArrays = false; |
137 | this.clearTimelinePanel(); | 140 | this.clearTimelinePanel(); |
138 | this._boolCacheArrays = true; | 141 | this._boolCacheArrays = true; |
139 | this.enablePanel(false); | 142 | this.enablePanel(false); |
140 | } else if(this._currentDocument.currentView === "design") { | 143 | } else { |
141 | this._boolCacheArrays = false; | 144 | if(boolView === true) { |
142 | this.clearTimelinePanel(); | 145 | this._boolCacheArrays = false; |
143 | this._boolCacheArrays = true; | 146 | this.clearTimelinePanel(); |
144 | 147 | this._boolCacheArrays = true; | |
145 | // Rebind the document events for the new document context | 148 | |
146 | this._bindDocumentEvents(); | 149 | // Rebind the document events for the new document context |
147 | 150 | this._bindDocumentEvents(); | |
148 | // Initialize the timeline for the document. | 151 | |
149 | this.initTimelineForDocument(); | 152 | // Initialize the timeline for the document. |
153 | this.initTimelineForDocument(); | ||
154 | this.enablePanel(true); | ||
155 | } | ||
150 | } | 156 | } |
151 | } | 157 | } |
152 | }, | 158 | }, |