From 9f39474ac006be7decf67437d8ef14c9ee0a1756 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 18 Apr 2012 10:20:33 -0700 Subject: FIX for layer selection when adding a keyframe in unselected layer Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 5 +++++ js/panels/Timeline/Tween.reel/Tween.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 25452891..84d93ea3 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -548,6 +548,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { handleNewTween:{ value:function (ev) { if (ev.offsetX > this.tweens[this.tweens.length - 1].tweenData.keyFramePosition) { + var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + this.application.ninja.timeline.selectLayer(selectedIndex, false); this.insertTween(ev.offsetX); } else { this.splitTween(ev); @@ -557,6 +559,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { insertTween:{ value:function (clickPos) { + var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + this.application.ninja.timeline.selectLayer(selectedIndex, true); + var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); var currentMillisec = currentMillisecPerPixel * clickPos; this.trackDuration = currentMillisec; diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index e4fb42b3..5fdf71d6 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -186,7 +186,7 @@ var Tween = exports.Tween = Montage.create(Component, { setAbsoluteTweenProperties:{ value:function (eventDetail) { - console.log(eventDetail); + //console.log(eventDetail); if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) { this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop; this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft; @@ -200,7 +200,7 @@ var Tween = exports.Tween = Montage.create(Component, { setRelativeTweenProperties:{ value:function(eventDetail){ - + //console.log(eventDetail); } }, -- cgit v1.2.3