From a831e11ef6ae97bbd90c896b5cb6f4306e9001dd Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 4 May 2012 23:30:49 -0700 Subject: more sub prop additions Signed-off-by: Jonathan Duran --- js/panels/Timeline/Layer.reel/Layer.js | 34 ++++++++++------------ .../Timeline/PropertyTrack.reel/PropertyTrack.js | 3 +- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 2 +- 3 files changed, 17 insertions(+), 22 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 9edd2b35..233e811f 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -51,6 +51,7 @@ var Layer = exports.Layer = Montage.create(Component, { value: false }, styleRepetition : { + serializable: true, get: function() { return this._styleRepetition; }, @@ -61,8 +62,17 @@ var Layer = exports.Layer = Montage.create(Component, { _styleCounter : { value: 0 }, + styleCounter:{ + serializable:true, + get:function () { + return this._styleCounter; + }, + set:function (newVal) { + this._styleCounter = newVal; + } + }, - /* Layer models: the name, ID, and selected and animation booleans for the layer */ + /* Layer models: the name, ID, and selected and animation booleans for the layer */ _layerName:{ value: "Default Layer Name" }, @@ -635,8 +645,8 @@ var Layer = exports.Layer = Montage.create(Component, { newEvent.layerEventLocale = "styles"; newEvent.layerEventType = "newStyle"; newEvent.layerID = this.layerID; - newEvent.styleIndex = this._styleCounter; - newEvent.styleID = this.layerID + "@" + this._styleCounter; + newEvent.styleIndex = this.styleCounter; + newEvent.styleID = this.layerID + "@" + this.styleCounter; newStyle.styleID = newEvent.styleID; newStyle.whichView = "hintable"; @@ -644,26 +654,12 @@ var Layer = exports.Layer = Montage.create(Component, { newStyle.editorValue = ""; newStyle.ruleTweener = false; newStyle.isSelected = false; + this.arrLayerStyles.push(newStyle); - if (!!this.styleRepetition.selectedIndexes) { - mySelection = this.styleRepetition.selectedIndexes[0]; - this.arrLayerStyles.splice(mySelection, 0, newStyle); - //this.styleRepetition.selectedIndexes = [mySelection]; - this.selectStyle(mySelection); - } else { - newLength = this.arrLayerStyles.length; - this.arrLayerStyles.push(newStyle); - mySelection = this.arrLayerStyles.length; - // this.styleRepetition.selectedIndexes = [mySelection-1]; - this.selectStyle(mySelection-1); - } - // Set up the event info and dispatch the event - this._styleCounter += 1; + this.styleCounter += 1; newEvent.styleSelection = mySelection; defaultEventManager.dispatchEvent(newEvent); - - } }, deleteStyle : { diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index f2dbd683..54be3faf 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js @@ -157,8 +157,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { // check if there is an editor property assigned yet // get this property track's editor prop name from layer data arrays var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); - console.log(this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles); - console.log(this.styleIndex); + console.log(this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles[this.styleIndex].editorProperty); this.insertPropTween(0); this.addPropAnimationRuleToElement(ev); diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 63f2f957..ddeb1449 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -819,7 +819,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newStyleTrack.propTrackData.styleSelection = layerEvent.styleSelection; newStyleTrack.propTrackData.propTweens = []; newStyleTrack.propTrackData.styleIndex = layerEvent.styleIndex; - console.log(layerEvent.styleSelection); + console.log(layerEvent.styleIndex); this.arrStyleTracks.push(newStyleTrack); -- cgit v1.2.3