aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel
diff options
context:
space:
mode:
authorJonathan Duran2012-03-07 09:28:10 -0800
committerJonathan Duran2012-03-07 09:28:10 -0800
commitc92ac883d43be0b8f89a04505ec11235d2856382 (patch)
tree51ef3f9ffc3da45542f695e1bb3d98e7211e9c7c /js/panels/Timeline/Tween.reel
parent27f0a1813a0a025448c36b458d8a441a1459bf9a (diff)
downloadninja-c92ac883d43be0b8f89a04505ec11235d2856382.tar.gz
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 <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Tween.reel')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js43
1 files changed, 28 insertions, 15 deletions
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, {
14 value: true 14 value: true
15 }, 15 },
16 16
17 _tweenData:{
18 serializable: true,
19 value:{}
20 },
21
22 tweenData:{
23 serializable: true,
24 get:function(){
25 return this._tweenData;
26 },
27 set:function(val){
28 this._tweenData = val;
29 this.setData();
30 }
31 },
32
17 _spanWidth: { 33 _spanWidth: {
18 serializable: true, 34 serializable: true,
19 value: 0 35 value: 0
@@ -118,21 +134,6 @@ var Tween = exports.Tween = Montage.create(Component, {
118 this.needsDraw = true; 134 this.needsDraw = true;
119 } 135 }
120 }, 136 },
121
122 _isClearing : {
123 serializable: true,
124 value: false
125 },
126 isClearing : {
127 get: function() {
128 return this._isClearing;
129 },
130 set: function(newVal) {
131 if (newVal === "clear it") {
132 this.eventManager.removeEventListener("elementChange", this, false);
133 }
134 }
135 },
136 137
137 draw:{ 138 draw:{
138 value:function () { 139 value:function () {
@@ -145,6 +146,18 @@ var Tween = exports.Tween = Montage.create(Component, {
145 } 146 }
146 }, 147 },
147 148
149 setData:{
150 value:function(){
151 this.spanWidth = this.tweenData.spanWidth;
152 this.keyFramePosition = this.tweenData.keyFramePosition;
153 this.spanPosition = this.tweenData.spanPosition;
154 this.keyFrameMillisec = this.tweenData.keyFrameMillisec;
155 this.tweenID = this.tweenData.tweenID;
156 this.tweenedProperties = this.tweenData.tweenedProperties;
157 this.isTweenAnimated = this.tweenData.isTweenAnimated;
158 }
159 },
160
148 handleElementChange:{ 161 handleElementChange:{
149 value:function (event) { 162 value:function (event) {
150 163