From d6f3f53a86f4efc45eabb519c94456731f6425e1 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 17 Apr 2012 15:30:44 -0700 Subject: Timeline: Bug fix: changing layer name didn't save in some circumstances. --- js/panels/Timeline/Layer.reel/Layer.js | 2 ++ js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 3bc87f68..36c77018 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -758,6 +758,8 @@ var Layer = exports.Layer = Montage.create(Component, { } this.dynamicLayerName.value = newVal; this.layerName = newVal; + this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; + this.application.ninja.documentController.activeDocument.needsSave = true; this.needsDraw = true; } }, diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 48bce268..0062affe 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -312,7 +312,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.initTimeline(); // Bind the event handler for the document change events this.eventManager.addEventListener("onOpenDocument", this.handleDocumentChange.bind(this), false); - //this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false); + this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false); this.eventManager.addEventListener("switchDocument", this.handleDocumentChange.bind(this), false); // Bind drag and drop event handlers @@ -682,7 +682,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleDocumentChange:{ value:function (event) { // Clear the timeline but not the cache - //console.log('TimelinePanel.handleDocumentChange') + //console.log('TimelinePanel.handleDocumentChange'); + if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) { + return; + } this._boolCacheArrays = false; this.clearTimelinePanel(); this._boolCacheArrays = true; -- cgit v1.2.3