From c92ac883d43be0b8f89a04505ec11235d2856382 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 7 Mar 2012 09:28:10 -0800 Subject: Optimize serialization bindings for Tween component Move all serialized properties of Tween component into on data object with one binding instead of multiple properties with individual bindings Signed-off-by: Jonathan Duran --- js/panels/Timeline/Tween.reel/Tween.js | 43 ++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'js/panels/Timeline/Tween.reel') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 6ff38bef..b9ec40ad 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -14,6 +14,22 @@ var Tween = exports.Tween = Montage.create(Component, { value: true }, + _tweenData:{ + serializable: true, + value:{} + }, + + tweenData:{ + serializable: true, + get:function(){ + return this._tweenData; + }, + set:function(val){ + this._tweenData = val; + this.setData(); + } + }, + _spanWidth: { serializable: true, value: 0 @@ -118,21 +134,6 @@ var Tween = exports.Tween = Montage.create(Component, { this.needsDraw = true; } }, - - _isClearing : { - serializable: true, - value: false - }, - isClearing : { - get: function() { - return this._isClearing; - }, - set: function(newVal) { - if (newVal === "clear it") { - this.eventManager.removeEventListener("elementChange", this, false); - } - } - }, draw:{ value:function () { @@ -145,6 +146,18 @@ var Tween = exports.Tween = Montage.create(Component, { } }, + setData:{ + value:function(){ + this.spanWidth = this.tweenData.spanWidth; + this.keyFramePosition = this.tweenData.keyFramePosition; + this.spanPosition = this.tweenData.spanPosition; + this.keyFrameMillisec = this.tweenData.keyFrameMillisec; + this.tweenID = this.tweenData.tweenID; + this.tweenedProperties = this.tweenData.tweenedProperties; + this.isTweenAnimated = this.tweenData.isTweenAnimated; + } + }, + handleElementChange:{ value:function (event) { -- cgit v1.2.3