From 403d0834a23760c2481be050a8be925c1ba64a1b Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 21 Jun 2012 12:14:59 -0700 Subject: Timeline: Bug fix IKNINJA-1783, Timeline panel is disabled when CSS file is open in another tab. --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b8ba5feb..1ba9f067 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -118,9 +118,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { return; } - if(!this._currentDocument && value.currentView === "design") { - this.enablePanel(true); - } + // Should we enable the panel? + if (typeof(this._currentDocument) !== "undefined") { + // We have a document, or at least we have initialized the panel. + // What view are we in? + if (typeof(value) !== "undefined") { + if (value.currentView === "design") { + // We are in design view, so enable the panel. + this.enablePanel(true); + } + } + } this._currentDocument = value; @@ -893,7 +901,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.drawTimeMarkers(); // Document switching // Check to see if we have saved timeline information in the currentDocument. - //console.log("TimelinePanel.initTimelineForDocument"); + // console.log("TimelinePanel.initTimelineForDocument"); if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) { // console.log('TimelinePanel.initTimelineForDocument: new Document'); -- cgit v1.2.3