aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 09378e65..d5571c3c 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -442,6 +442,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
442 this.element.addEventListener("click", this, false); 442 this.element.addEventListener("click", this, false);
443 this.eventManager.addEventListener("tlZoomSlider", this, false); 443 this.eventManager.addEventListener("tlZoomSlider", this, false);
444 444
445 // Drag and Drop event handlers
445 this.element.addEventListener("dragover", this.handleKeyframeDragover.bind(this), false); 446 this.element.addEventListener("dragover", this.handleKeyframeDragover.bind(this), false);
446 this.element.addEventListener("dragstart", this.handleKeyframeDragstart.bind(this), false); 447 this.element.addEventListener("dragstart", this.handleKeyframeDragstart.bind(this), false);
447 this.element.addEventListener("dragend", this.handleKeyframeDragend.bind(this), false); 448 this.element.addEventListener("dragend", this.handleKeyframeDragend.bind(this), false);
@@ -873,6 +874,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
873 }, 874 },
874 handleKeyframeDragover: { 875 handleKeyframeDragover: {
875 value: function(event) { 876 value: function(event) {
877 event.preventDefault();
876 var currPos = 0; 878 var currPos = 0;
877 /* 879 /*
878 myScrollTest = ((event.y - (this._dragAndDropHelperOffset - this.user_layers.scrollTop)) + 28) - this.user_layers.scrollTop; 880 myScrollTest = ((event.y - (this._dragAndDropHelperOffset - this.user_layers.scrollTop)) + 28) - this.user_layers.scrollTop;
@@ -891,9 +893,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
891 } 893 }
892 */ 894 */
893 //currPos = event.y - (this._dragAndDropHelperOffset - this.user_layers.scrollTop)- 28; 895 //currPos = event.y - (this._dragAndDropHelperOffset - this.user_layers.scrollTop)- 28;
894 currPos = event.x - 280; 896 currPos = event.x - 277;
895 this._dragAndDropHelperCoords = currPos + "px"; 897 this._dragAndDropHelperCoords = currPos + "px";
896 this.needsDraw = true; 898 this.needsDraw = true;
899 return false;
897 } 900 }
898 }, 901 },
899 902
@@ -912,6 +915,24 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
912 //if (this.parentComponent.parentComponent.dragLayerID !== this.layerID) { 915 //if (this.parentComponent.parentComponent.dragLayerID !== this.layerID) {
913 //this.parentComponent.parentComponent.dropLayerID = this.layerID; 916 //this.parentComponent.parentComponent.dropLayerID = this.layerID;
914 //} 917 //}
918
919 /*
920 * First, what keyframe is it (get the index);
921 * Limit keyframe position to between index-1 and index+1 keyFramePosition
922 * On update, be sure to update index+1's information too
923 *
924 */
925
926 var currPos = event.x - 277,
927 currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80),
928 currentMillisec = currentMillisecPerPixel * currPos;
929 console.log(this.tweens[1].tweenData);
930 this.tweens[1].tweenData.spanWidth = currPos - this.tweens[0].tweenData.keyFramePosition;
931 this.tweens[1].tweenData.keyFramePosition = currPos;
932 this.tweens[1].tweenData.keyFrameMillisec = currentMillisec;
933 this.tweens[1].tweenData.spanPosition = currPos - this.tweens[1].tweenData.spanWidth;
934 this.tweenRepetition.childComponents[1].setData();
935 console.log(this.tweens[1].tweenData);
915 return false; 936 return false;
916 } 937 }
917 }, 938 },