aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJonathan Duran2012-04-18 10:20:33 -0700
committerJonathan Duran2012-04-18 10:20:33 -0700
commit9f39474ac006be7decf67437d8ef14c9ee0a1756 (patch)
tree04f08dce52bb44b3f6f560f3f69b7188a7fc417b /js/panels
parentc6f16dd25c5bb3fc144db66d42edb19b29720aa3 (diff)
downloadninja-9f39474ac006be7decf67437d8ef14c9ee0a1756.tar.gz
FIX for layer selection when adding a keyframe in unselected layer
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js5
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js4
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, {
548 handleNewTween:{ 548 handleNewTween:{
549 value:function (ev) { 549 value:function (ev) {
550 if (ev.offsetX > this.tweens[this.tweens.length - 1].tweenData.keyFramePosition) { 550 if (ev.offsetX > this.tweens[this.tweens.length - 1].tweenData.keyFramePosition) {
551 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
552 this.application.ninja.timeline.selectLayer(selectedIndex, false);
551 this.insertTween(ev.offsetX); 553 this.insertTween(ev.offsetX);
552 } else { 554 } else {
553 this.splitTween(ev); 555 this.splitTween(ev);
@@ -557,6 +559,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
557 559
558 insertTween:{ 560 insertTween:{
559 value:function (clickPos) { 561 value:function (clickPos) {
562 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
563 this.application.ninja.timeline.selectLayer(selectedIndex, true);
564
560 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 565 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
561 var currentMillisec = currentMillisecPerPixel * clickPos; 566 var currentMillisec = currentMillisecPerPixel * clickPos;
562 this.trackDuration = currentMillisec; 567 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, {
186 186
187 setAbsoluteTweenProperties:{ 187 setAbsoluteTweenProperties:{
188 value:function (eventDetail) { 188 value:function (eventDetail) {
189 console.log(eventDetail); 189 //console.log(eventDetail);
190 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) { 190 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) {
191 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop; 191 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop;
192 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft; 192 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft;
@@ -200,7 +200,7 @@ var Tween = exports.Tween = Montage.create(Component, {
200 200
201 setRelativeTweenProperties:{ 201 setRelativeTweenProperties:{
202 value:function(eventDetail){ 202 value:function(eventDetail){
203 203 //console.log(eventDetail);
204 } 204 }
205 }, 205 },
206 206