From e9995c973acadc507b802fdefdb22b4c4bf82325 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 15 May 2012 11:27:51 -0700 Subject: fix keyframe splitting Signed-off-by: Jonathan Duran --- js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 9 +++++++-- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 4 ++++ js/panels/Timeline/Tween.reel/Tween.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index b3a31bf2..f2004b94 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js @@ -201,7 +201,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { //console.log("Property track editorProperty set to: " + this.trackEditorProperty); } } else if (this.trackType === "position") { - console.log("Property track editorProperty set to: " + this.trackEditorProperty); + //console.log("Property track editorProperty set to: " + this.trackEditorProperty); } this.insertPropTween(0); @@ -217,7 +217,12 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { handleNewPropTween:{ value:function(ev){ - this.insertPropTween(ev.offsetX); + if (ev.offsetX > this.propTweens[this.propTweens.length - 1].tweenData.keyFramePosition) { + this.insertPropTween(ev.offsetX); + } else { + console.log("spitting sub keyframes not yet supported"); + } + } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index b55db18a..a38ecb30 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -603,9 +603,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.addAnimationRuleToElement(ev); this.updateKeyframeRule(); } else { + //console.log(ev); if (ev.target.className === "tracklane") { this.handleNewTween(ev); this.updateKeyframeRule(); + } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane"){ + this.handleNewTween(ev); + this.updateKeyframeRule(); } } } else { diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index fb2ce4b4..33fed17a 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -280,7 +280,7 @@ var Tween = exports.Tween = Montage.create(Component, { // set property specific style on element var currentValue = this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty]; this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], this.parentComponent.parentComponent.trackEditorProperty, [currentValue], "Change", "tween"); - + //console.log(currentValue); } else { // move animated element to correct position on stage var currentTop = this.tweenedProperties["top"] + "px"; -- cgit v1.2.3