From 59de13ed9f88497b07b4fdcf4d2c9d5c2bf05365 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Wed, 4 Apr 2012 10:54:29 -0700 Subject: Timeline: Saving layername Signed-off-by: Kruti Shah --- js/panels/Timeline/Layer.reel/Layer.js | 1 + js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index c69f28b0..300462ee 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -490,6 +490,7 @@ var Layer = exports.Layer = Montage.create(Component, { }, false); this._layerEditable.addEventListener("change", function(event) { that.dynamicLayerName.value = that._layerEditable.value; + this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = that.dynamicLayerName.value that.needsDraw = true; }, false); this._layerEditable.editingClass = "editable2"; diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index c454130c..0ca4800d 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -747,6 +747,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentLayerNumber = this.currentLayerNumber + 1; newLayerName = "Layer " + this.currentLayerNumber; + + if(ele.dataset.storedLayerName){ + newLayerName = ele.dataset.storedLayerName; + } thingToPush.layerData.layerName = newLayerName; thingToPush.layerData.layerID = this.currentLayerNumber; thingToPush.parentElementUUID = this.hashKey; @@ -787,6 +791,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function() { this.createNewLayer(); this.currentLayerSelected.layerData.elementsList.push(this.application.ninja.selectedElements[0]._element); + this.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.currentLayerSelected.layerData.layerName; } }, -- cgit v1.2.3