From 15edcb5fe22793aab024c1ef7dde109b36977dd8 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 16 Jul 2012 09:20:10 -0700 Subject: Timeline: Disable drag-and-drop on subproperty keyframes. Better error handling. Fix some minor bugs. --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index a52150af..b771f6f3 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -119,14 +119,21 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { value: function(event) { event.dataTransfer.setData('Text', 'Keyframe'); var i = 0, - tweenRepetitionLength = this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents.length, + tweenRepetitionLength, + myTrack, myIndex = null; + if (typeof(this.parentComponent.parentComponent.parentComponent.tweenRepetition) !== "undefined") { + myTrack = this.parentComponent.parentComponent.parentComponent; + } else { + myTrack = this.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent; + } + tweenRepetitionLength = myTrack.tweenRepetition.childComponents.length; for (i = 0; i < tweenRepetitionLength; i++) { - if (this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents[i].uuid === this.parentComponent.uuid) { + if (myTrack.tweenRepetition.childComponents[i].uuid === this.parentComponent.uuid) { myIndex = i; } } - this.parentComponent.parentComponent.parentComponent.draggingIndex = myIndex; + myTrack.draggingIndex = myIndex; this.selectKeyframe(); } }, -- cgit v1.2.3 From 33e54da07d024ece1d52041d4ed2bcc28b8cbca3 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 16 Jul 2012 15:38:59 -0700 Subject: Timeline: Ameliorate slowness when adding first keyframe to an element. --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index b771f6f3..13902ddb 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -158,7 +158,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { return; } this.isSelected=true; - this.element.style.left = (this.position - 6) + "px"; + //this.element.style.left = (this.position - 6) + "px"; Moved to draw cycle. this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; this.parentComponent.selectTween(); } @@ -167,7 +167,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { deselectKeyframe:{ value:function () { this.isSelected = false; - this.element.style.left = (this.position - 5) + "px"; + // this.element.style.left = (this.position - 5) + "px"; Moved to draw cycle } } // ==== End Controllers -- cgit v1.2.3