From e600253fa8e6027c4bac7ebb69e0d4ce12a76ff8 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 18 Jun 2012 16:46:00 -0700 Subject: Timeline: Enable splitting of keyframes with F6 interaction. Bug fix: Error on console if you press F6 with no layer selected. --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 7 ++++++- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 27b3537c..339ca5a4 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1016,7 +1016,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { //console.log(this.trackRepetition); var tempEv = {}; tempEv.offsetX = this.playheadmarker.offsetLeft; - this.trackRepetition.childComponents[this.currentLayersSelected[0]].handleKeyboardShortcut(tempEv); + if (typeof(this.trackRepetition.childComponents[this.currentLayersSelected[0]]) !== "undefined") { + this.trackRepetition.childComponents[this.currentLayersSelected[0]].handleKeyboardShortcut(tempEv); + } else { + // oops, we do not have a layer selected. We should growl at the user. For now, this will fail silently. + } + } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index a4d20c39..84bac2cb 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -703,9 +703,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.addAnimationRuleToElement(ev); this.updateKeyframeRule(); } else { - - - this.handleNewTween(ev); + //this.handleNewTween(ev); + + // Split a tween! + this.splitTweenAt(this.application.ninja.timeline.playheadmarker.offsetLeft) this.updateKeyframeRule(); } } -- cgit v1.2.3