aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
authorKruti Shah2012-07-17 17:29:26 -0700
committerKruti Shah2012-07-17 17:29:26 -0700
commit49233086e159137bf6d6b0ee73947475b0d08092 (patch)
tree2ad21c0c0865efaf9284cb2fe233ad203f59605f /js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
parentbf2d7bdb22c28089dc1067bc9094ebc590daac87 (diff)
downloadninja-49233086e159137bf6d6b0ee73947475b0d08092.tar.gz
Multi Doc Zoom Slider Handling
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js44
1 files changed, 1 insertions, 43 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 2581df0f..5fff33d9 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -506,7 +506,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
506 this.init(); 506 this.init();
507 this.ninjaStylesContoller = this.application.ninja.stylesController; 507 this.ninjaStylesContoller = this.application.ninja.stylesController;
508 this.element.addEventListener("click", this, false); 508 this.element.addEventListener("click", this, false);
509 this.eventManager.addEventListener("tlZoomSlider", this, false); 509
510 510
511 // Drag and Drop event handlers 511 // Drag and Drop event handlers
512 this.element.addEventListener("dragstart", this.handleKeyframeDragstart.bind(this), false); 512 this.element.addEventListener("dragstart", this.handleKeyframeDragstart.bind(this), false);
@@ -593,48 +593,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
593 // ==== End Draw cycle methods 593 // ==== End Draw cycle methods
594 594
595 // ==== Begin Event handlers 595 // ==== Begin Event handlers
596 handleTlZoomSlider: {
597 value: function(event) {
598
599 var currentMilliSecPerPixel , currentMilliSec , clickPos,thingToPush;
600 var i = 0,
601 tweensLength = this.tweens.length;
602
603 for (i = 0; i < tweensLength; i++) {
604
605 if (i === 0) {
606 // Exception: 0th item does not depend on anything
607 // If 0th tween is draggable, this will need to be fixed.
608 this.tweens[i].tweenData.spanWidth=0;
609 this.tweens[i].tweenData.spanPosition=0;
610 this.tweens[i].tweenData.keyFramePosition=0;
611 this.tweens[i].tweenData.keyFrameMillisec=0;
612
613 } else {
614 var prevKeyFramePosition = this.tweens[i - 1].tweenData.keyFramePosition,
615 myObj = {},
616 thing = {};
617
618 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
619 currentMilliSec = this.tweens[i].tweenData.keyFrameMillisec;
620 clickPos = currentMilliSec / currentMilliSecPerPixel;
621
622 for (thing in this.tweens[i].tweenData) {
623 myObj[thing] = this.tweens[i].tweenData[thing];
624 }
625 myObj.spanWidth = clickPos - prevKeyFramePosition;
626 myObj.keyFramePosition = clickPos;
627 myObj.spanPosition = clickPos - (clickPos - prevKeyFramePosition);
628
629 this.tweens[i].tweenData = myObj;
630
631
632 }
633 }
634 this.application.ninja.timeline.zoomTrackContainerWidthChange();
635
636 }
637 },
638 596
639 handleClick:{ 597 handleClick:{
640 value:function (ev) { 598 value:function (ev) {