aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Span.reel/Span.js
diff options
context:
space:
mode:
authorKruti Shah2012-07-09 10:53:35 -0700
committerKruti Shah2012-07-09 10:53:35 -0700
commit8a2a9cf8d43a1ba7e40c41619e7db9675f4cb195 (patch)
tree93e10a0895677c545591ae698b4f7d0b2180d0c9 /js/panels/Timeline/Span.reel/Span.js
parent028e0a2ccde5458303d90a9dd6c4fde09b1b6565 (diff)
downloadninja-8a2a9cf8d43a1ba7e40c41619e7db9675f4cb195.tar.gz
Refactoring Code
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Span.reel/Span.js')
-rw-r--r--js/panels/Timeline/Span.reel/Span.js43
1 files changed, 28 insertions, 15 deletions
diff --git a/js/panels/Timeline/Span.reel/Span.js b/js/panels/Timeline/Span.reel/Span.js
index f588a0eb..ffe7f4a4 100644
--- a/js/panels/Timeline/Span.reel/Span.js
+++ b/js/panels/Timeline/Span.reel/Span.js
@@ -13,7 +13,7 @@ var Span = exports.Span = Montage.create(Component, {
13 value: true 13 value: true
14 }, 14 },
15 15
16 // BEGIN: Models 16 /* Begin: Models */
17 _spanWidth:{ 17 _spanWidth:{
18 value:0 18 value:0
19 }, 19 },
@@ -79,8 +79,10 @@ var Span = exports.Span = Montage.create(Component, {
79 } 79 }
80 } 80 }
81 }, 81 },
82
83 /* End: Models */
82 84
83 // BEGIN: draw cycle 85 /* Begin: Draw Cycle */
84 prepareForDraw: { 86 prepareForDraw: {
85 value: function() { 87 value: function() {
86 this.init(); 88 this.init();
@@ -89,7 +91,9 @@ var Span = exports.Span = Montage.create(Component, {
89 91
90 draw:{ 92 draw:{
91 value: function(){ 93 value: function(){
92 var containerWidth , choiceWidth; 94 var containerWidth ,
95 choiceWidth;
96
93 this.element.style.width = this.spanWidth + "px"; 97 this.element.style.width = this.spanWidth + "px";
94 98
95 if ((this.spanWidth <= 70) && (this.spanWidth >0)) { 99 if ((this.spanWidth <= 70) && (this.spanWidth >0)) {
@@ -123,18 +127,9 @@ var Span = exports.Span = Montage.create(Component, {
123 } 127 }
124 }, 128 },
125 129
126 // BEGIN: Controllers 130 /* End: Draw Cycle */
127 init: { 131
128 value: function() { 132 /* Begin : Event Handlers */
129 this.easing_choice.addEventListener("click", this.handleEasingChoiceClick.bind(this), false);
130 }
131 },
132
133 highlightSpan:{
134 value: function(){
135 this.isHighlighted = true;
136 }
137 },
138 133
139 handleEasingChoiceClick: { 134 handleEasingChoiceClick: {
140 value: function(event) { 135 value: function(event) {
@@ -181,9 +176,27 @@ var Span = exports.Span = Montage.create(Component, {
181 this.hideEasingMenu(); 176 this.hideEasingMenu();
182 } 177 }
183 }, 178 },
179
180 /* End : Event Handlers */
181
182 /* Begin: Controllers */
183 init: {
184 value: function() {
185 this.easing_choice.addEventListener("click", this.handleEasingChoiceClick.bind(this), false);
186 }
187 },
188
189 highlightSpan:{
190 value: function(){
191 this.isHighlighted = true;
192 }
193 },
194
184 hideEasingMenu: { 195 hideEasingMenu: {
185 value: function() { 196 value: function() {
186 this.application.ninja.timeline.easingMenu.hide(); 197 this.application.ninja.timeline.easingMenu.hide();
187 } 198 }
188 } 199 }
200
201 /* End : Controllers */
189}); 202});