aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Duran2012-05-11 02:34:26 -0700
committerJonathan Duran2012-05-11 02:34:26 -0700
commit32257ac142f872d3c1f6c07504bae77ae884ed93 (patch)
tree46e8df48535e7b2feaffde7dfd9a17fdca2f5dcc
parent675dfa5057e118dac694b8fb9b960cfed48e1d52 (diff)
downloadninja-32257ac142f872d3c1f6c07504bae77ae884ed93.tar.gz
Fix a bug in span splitting interaction and remove console logs
Signed-off-by: Jonathan Duran <jduran@motorola.com>
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js5
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js8
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js17
3 files changed, 14 insertions, 16 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
index e5fa71d3..2d3ab72f 100644
--- a/js/panels/Timeline/Keyframe.reel/Keyframe.js
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js
@@ -37,11 +37,6 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
37 this.element.addEventListener("mouseout", this.handleMouseout.bind(this), false); 37 this.element.addEventListener("mouseout", this.handleMouseout.bind(this), false);
38 this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false); 38 this.element.addEventListener("dragstart", this.handleDragstart.bind(this), false);
39 this.element.addEventListener("dragend", this.handleDragend.bind(this), false); 39 this.element.addEventListener("dragend", this.handleDragend.bind(this), false);
40
41
42
43
44
45 } 40 }
46 }, 41 },
47 42
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 53b7bd5e..690c912b 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -154,7 +154,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
154 handleClick:{ 154 handleClick:{
155 value:function(ev){ 155 value:function(ev){
156 if (ev.shiftKey) { 156 if (ev.shiftKey) {
157 console.log(this.trackType); 157
158 if (this.propTweens.length < 1) { 158 if (this.propTweens.length < 1) {
159 159
160 // check if there is an editor property assigned yet 160 // check if there is an editor property assigned yet
@@ -170,8 +170,8 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
170 console.log("Property track editorProperty set to: " + this.trackEditorProperty); 170 console.log("Property track editorProperty set to: " + this.trackEditorProperty);
171 } 171 }
172 } else if (this.trackType === "position") { 172 } else if (this.trackType === "position") {
173 console.log("clicking on position track"); 173 //console.log("clicking on position track");
174 console.log(this.trackEditorProperty); 174 //console.log(this.trackEditorProperty);
175 } 175 }
176 176
177 this.insertPropTween(0); 177 this.insertPropTween(0);
@@ -239,7 +239,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
239 value:function(tweenEvent){ 239 value:function(tweenEvent){
240 this.insertPropTween(tweenEvent.offsetX); 240 this.insertPropTween(tweenEvent.offsetX);
241 this.animationName = this.parentComponent.parentComponent.parentComponent.animationName; 241 this.animationName = this.parentComponent.parentComponent.parentComponent.animationName;
242 console.log(this.animationName); 242 //console.log(this.animationName);
243 } 243 }
244 } 244 }
245}); 245});
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 35440cc4..1731213b 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -617,6 +617,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
617 this.application.ninja.timeline.selectLayer(selectedIndex, false); 617 this.application.ninja.timeline.selectLayer(selectedIndex, false);
618 this.insertTween(ev.offsetX); 618 this.insertTween(ev.offsetX);
619 } else { 619 } else {
620 console.log(ev.target);
620 this.splitTween(ev); 621 this.splitTween(ev);
621 } 622 }
622 } 623 }
@@ -671,7 +672,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
671 672
672 splitTween:{ 673 splitTween:{
673 value:function (ev) { 674 value:function (ev) {
674 console.log("Splitting an existing span with a new keyframe.");
675 var clickPos = ev.target.parentElement.offsetLeft + ev.offsetX; 675 var clickPos = ev.target.parentElement.offsetLeft + ev.offsetX;
676 var i; 676 var i;
677 var tweensLength = this.tweens.length-1; 677 var tweensLength = this.tweens.length-1;
@@ -680,14 +680,17 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
680 prevTween = this.tweens[i].tweenData.keyFramePosition; 680 prevTween = this.tweens[i].tweenData.keyFramePosition;
681 nextTween = this.tweens[i+1].tweenData.keyFramePosition; 681 nextTween = this.tweens[i+1].tweenData.keyFramePosition;
682 if(clickPos > prevTween && clickPos < nextTween){ 682 if(clickPos > prevTween && clickPos < nextTween){
683 console.log(clickPos + " found on tween: "+ this.tweens[i+1].tweenData.tweenID); 683 //console.log(clickPos + " found on tween: "+ this.tweens[i+1].tweenData.tweenID);
684 splitTweenIndex = this.tweens[i+1].tweenData.tweenID; 684 splitTweenIndex = this.tweens[i+1].tweenData.tweenID;
685 this.tweens[i+1].tweenData.spanWidth = this.tweens[i+1].tweenData.keyFramePosition - clickPos; 685 this.tweens[i+1].tweenData.spanWidth = this.tweens[i+1].tweenData.keyFramePosition - clickPos;
686 this.tweens[i+1].tweenData.spanPosition = ev.target.parentElement.offsetLeft + ev.offsetX; 686 this.tweens[i+1].tweenData.spanPosition = ev.target.parentElement.offsetLeft + ev.offsetX;
687 ev.target.style.width = this.tweens[i+1].tweenData.spanWidth + "px"; 687 if (ev.target.className != "tween-span") {
688 ev.target.parentElement.style.left = clickPos + "px"; 688 // don't set styles on timeline track if event is coming from the track
689 ev.target.parentElement.children[1].style.left = (this.tweens[i+1].tweenData.spanWidth - 3) + "px"; 689 } else {
690 690 ev.target.style.width = this.tweens[i + 1].tweenData.spanWidth + "px";
691 ev.target.parentElement.style.left = clickPos + "px";
692 ev.target.parentElement.children[1].style.left = (this.tweens[i + 1].tweenData.spanWidth - 3) + "px";
693 }
691 var newTweenToInsert = {}; 694 var newTweenToInsert = {};
692 newTweenToInsert.tweenData = {}; 695 newTweenToInsert.tweenData = {};
693 newTweenToInsert.tweenData.spanWidth = clickPos - prevTween; 696 newTweenToInsert.tweenData.spanWidth = clickPos - prevTween;
@@ -701,9 +704,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
701 newTweenToInsert.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth; 704 newTweenToInsert.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth;
702 newTweenToInsert.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight; 705 newTweenToInsert.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight;
703 this.tweens.splice(splitTweenIndex, 0, newTweenToInsert); 706 this.tweens.splice(splitTweenIndex, 0, newTweenToInsert);
707 break;
704 } 708 }
705 } 709 }
706
707 this.application.ninja.documentController.activeDocument.needsSave = true; 710 this.application.ninja.documentController.activeDocument.needsSave = true;
708 } 711 }
709 }, 712 },