From 04f206173530b6efde16b934b1f959b255d18441 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 22 Jun 2012 01:33:58 -0700 Subject: FIx - can't delete keyframes F5 now deletes the selected keyframe Signed-off-by: Jonathan Duran --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 6 +-- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 60 ++++++++++++++++++---- 2 files changed, 52 insertions(+), 14 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 2cbd9e2b..1c023fdb 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1034,17 +1034,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }, handleKeyframeShortcut:{ - value:function(){ - //console.log(this.currentLayersSelected); - //console.log(this.trackRepetition); + value:function(action){ var tempEv = {}; tempEv.offsetX = this.playheadmarker.offsetLeft; + tempEv.actionType = action; 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 bf380e00..85fce1ec 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -702,17 +702,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { handleKeyboardShortcut:{ value:function(ev){ - if (this.tweens.length < 1) { - this.insertTween(0); - this.addAnimationRuleToElement(ev); - this.updateKeyframeRule(); - } else { - //this.handleNewTween(ev); - - // Split a tween! - this.splitTweenAt(this.application.ninja.timeline.playheadmarker.offsetLeft) - this.updateKeyframeRule(); + if(ev.actionType == "insert"){ + if (this.tweens.length < 1) { + this.insertTween(0); + this.addAnimationRuleToElement(ev); + this.updateKeyframeRule(); + } else { + this.handleNewTween(ev); + + // Split a tween! + //this.splitTweenAt(this.application.ninja.timeline.playheadmarker.offsetLeft); + this.updateKeyframeRule(); + } + } else if(ev.actionType == "remove"){ + this.removeTween(); } + } }, @@ -801,6 +806,41 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } }, + removeTween:{ + value:function(){ + var tweenIDToRemove = this.application.ninja.timeline.selectedTweens[0].tweenID, + oldPosition = this.application.ninja.timeline.selectedTweens[0].spanPosition, + oldSpanWidth = this.application.ninja.timeline.selectedTweens[0].spanWidth; + + if(tweenIDToRemove == this.tweens[this.tweens.length-1].tweenData.tweenID){ + this.trackDuration = this.tweens[this.tweens.length-2].tweenData.keyFrameMillisec; + this.tweens.pop(); + return; + } + + // Update the next tween to have new span position and width. + this.tweens[tweenIDToRemove + 1].tweenData.spanPosition = oldPosition; + this.tweens[tweenIDToRemove + 1].spanPosition = oldPosition; + this.tweens[tweenIDToRemove + 1].tweenData.spanWidth = this.tweens[tweenIDToRemove + 1].tweenData.spanWidth + oldSpanWidth; + this.tweens[tweenIDToRemove + 1].spanWidth = this.tweens[tweenIDToRemove + 1].spanWidth + oldSpanWidth; + + // redraw the tweens + for(var i in this.tweenRepetition.childComponents){ + this.tweenRepetition.childComponents[i].setData(); + } + + // remove the selected tween + this.tweens.splice(tweenIDToRemove, 1); + this.application.ninja.currentDocument.model.needsSave = true; + + // update the tween ids + for (var j = 0; j < this.tweens.length; j++) { + this.tweens[j].tweenID = j; + this.tweens[j].tweenData.tweenID = j; + } + } + }, + createMatchingPositionSizeTween:{ value:function (newTween) { var i; -- cgit v1.2.3 From 7563c059270d08395f52d9349bbe4d9aa9d9b99f Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 22 Jun 2012 11:22:47 -0700 Subject: Timeline fix - remove unneeded binding Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 1c023fdb..53a3b299 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -869,12 +869,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); - // Bind some bindings - Object.defineBinding(this, "currentSelectedContainer", { - boundObject:this.application.ninja, - boundObjectPropertyPath:"currentSelectedContainer", - oneway:true - }); this.addPropertyChangeListener("currentDocument.model.domContainer", this); // Start the panel out in disabled mode by default -- cgit v1.2.3 From 21edfc9a02df0ab4360d5eb41f9ef036500c681b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 25 Jun 2012 08:12:21 -0700 Subject: Timeline Fix - reopen subprop keyframes for Position and Size correctly Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 85fce1ec..68ea928a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -709,15 +709,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.updateKeyframeRule(); } else { this.handleNewTween(ev); - - // Split a tween! - //this.splitTweenAt(this.application.ninja.timeline.playheadmarker.offsetLeft); this.updateKeyframeRule(); } } else if(ev.actionType == "remove"){ this.removeTween(); + this.updateKeyframeRule(); } - } }, @@ -800,8 +797,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.createMatchingPositionSizeTween(newTween); } - - this.application.ninja.currentDocument.model.needsSave = true; } }, @@ -995,6 +990,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.easing = "none"; } this.tweens.push(newTween); + this.createMatchingPositionSizeTween(newTween); } this.nextKeyframe += 1; } @@ -1022,8 +1018,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { value:function(ruleSet){ for(var i in ruleSet){ var styleProp = ruleSet[i][0].style[0]; - //console.log(styleProp); - //console.log(ruleSet[i]); this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp, ruleSet[i]); } } -- cgit v1.2.3 From 48bb94a72126e7be712b2c4ca9be2f03ecb65aea Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 25 Jun 2012 14:54:16 -0700 Subject: IKNinja-1688 - Creating a banner file after a code file causes body div to shift to the right and has different scroll bars. Signed-off-by: Nivesh Rajbhandari --- js/panels/Splitter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index c6d46911..4f2a137e 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js @@ -156,7 +156,7 @@ exports.Splitter = Montage.create(Component, { } }, restore:{ - value: function() { + value: function(onSwitchFromCodeDocument) { //Get splitter initial value from SettingManager var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")), temp = this.collapsed; if(storedData && this.element.getAttribute("data-montage-id") !== null) { @@ -172,7 +172,11 @@ exports.Splitter = Montage.create(Component, { this.panel.addEventListener("webkitTransitionEnd", this, false); } this.disabled = false; - this.needsDraw = true; + if(onSwitchFromCodeDocument) { + this.draw(); // When switching from code document, draw immediately so stage size is correct + } else { + this.needsDraw = true; + } } } } -- cgit v1.2.3