From 8a2a9cf8d43a1ba7e40c41619e7db9675f4cb195 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Mon, 9 Jul 2012 10:53:35 -0700 Subject: Refactoring Code Signed-off-by: Kruti Shah --- js/panels/Timeline/Span.reel/Span.js | 43 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'js/panels/Timeline/Span.reel/Span.js') 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, { value: true }, - // BEGIN: Models + /* Begin: Models */ _spanWidth:{ value:0 }, @@ -79,8 +79,10 @@ var Span = exports.Span = Montage.create(Component, { } } }, + + /* End: Models */ - // BEGIN: draw cycle + /* Begin: Draw Cycle */ prepareForDraw: { value: function() { this.init(); @@ -89,7 +91,9 @@ var Span = exports.Span = Montage.create(Component, { draw:{ value: function(){ - var containerWidth , choiceWidth; + var containerWidth , + choiceWidth; + this.element.style.width = this.spanWidth + "px"; if ((this.spanWidth <= 70) && (this.spanWidth >0)) { @@ -123,18 +127,9 @@ var Span = exports.Span = Montage.create(Component, { } }, - // BEGIN: Controllers - init: { - value: function() { - this.easing_choice.addEventListener("click", this.handleEasingChoiceClick.bind(this), false); - } - }, - - highlightSpan:{ - value: function(){ - this.isHighlighted = true; - } - }, + /* End: Draw Cycle */ + + /* Begin : Event Handlers */ handleEasingChoiceClick: { value: function(event) { @@ -181,9 +176,27 @@ var Span = exports.Span = Montage.create(Component, { this.hideEasingMenu(); } }, + + /* End : Event Handlers */ + + /* Begin: Controllers */ + init: { + value: function() { + this.easing_choice.addEventListener("click", this.handleEasingChoiceClick.bind(this), false); + } + }, + + highlightSpan:{ + value: function(){ + this.isHighlighted = true; + } + }, + hideEasingMenu: { value: function() { this.application.ninja.timeline.easingMenu.hide(); } } + + /* End : Controllers */ }); -- cgit v1.2.3