From 390e5f7e3ba41ef0c71d1f944d926f9eee0c8846 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 12:34:30 -0700 Subject: Timeline: Bug fix IKNINJA-1816 --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 470062ba..ceb37db6 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -243,6 +243,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value: false }, + _areTracksCollapsing: { + value: false + }, + _currentOpenSpanMenu: { value: false }, @@ -687,6 +691,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // We have shuffled layers, so we need to update this.selectedLayers. this.selectLayers([]) } + + // Do we need to scroll the layers? + if (this._areTracksCollapsing !== false) { + //console.log("diddraw: user_layers, layout_tracks", this.user_layers.scrollTop, this.layout_tracks.scrollTop); + //this.layout_tracks.scrollTop = this.user_layers.scrollTop;\ + this.layout_tracks.scrollTop = this._areTracksCollapsing; + this._areTracksCollapsing = false; + } } }, @@ -1097,11 +1109,25 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.drawTimeMarkers(); } }, + + synchScrollbars: { + value: function(intScrollBy) { + //this.updateLayerScroll(); + //this.user_layers.scrollTop = 0; + //this.layout_tracks.scrollTop = this.user_layers.scrollTop; + //console.log("synch: user_layers, layout_tracks", this.user_layers.scrollTop, this.layout_tracks.scrollTop); + this._areTracksCollapsing = this.layout_tracks.scrollTop - intScrollBy; + this.needsDraw = true; + + } + }, updateLayerScroll:{ value:function () { + //console.log("TimelinePanel.updateLayerScroll") this._areTracksScrolling = true; this.needsDraw = true; + } }, -- cgit v1.2.3 From df6e43cea10a0c976390017ba41c33f74c4b7692 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 13:38:57 -0700 Subject: Fix - deselect tweens when selecting a layer Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 470062ba..040ae7be 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1188,6 +1188,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if (this.currentLayersSelected !== false) { this.currentLayersSelected = false; } + + // Deselect any tweens + this.deselectTweens(); // If we are actually going to be selecting things, create an empty array to use if (arrSelectedIndexesLength > 0) { -- cgit v1.2.3 From ab9d14780eed98f39786fae4518e69861b34bad7 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 14:56:58 -0700 Subject: Timeline: Bug fix: Keyboard shortcut now works for adding keyframes, including splitting tweens. --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 34 +++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index ceb37db6..3f1af281 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1090,10 +1090,36 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { 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. + + if (this.currentLayersSelected === false) { + // oops, we do not have a layer selected. We should growl at the user. For now, this will fail silently. + return; + } + + // Okay. We need to get the correct layer(s). For each currentElementSelected, + // loop through trackRepetition.childComponents and compare to stageElement. + // If they match, that's one of the components that needs the event. + var i = 0, + j = 0, + currentElementsSelectedLength = this.currentElementsSelected.length, + trackRepLength = this.trackRepetition.childComponents.length, + arrTargetIndexes = [], + arrTargetIndexesLength = 0; + + + for (i = 0; i < trackRepLength; i++) { + var currentElement = this.trackRepetition.childComponents[i].stageElement; + for (j = 0; j < currentElementsSelectedLength; j++) { + if (currentElement === this.currentElementsSelected[j]) { + arrTargetIndexes.push(i); + } + } + } + arrTargetIndexesLength = arrTargetIndexes.length; + + // Now we have an array of things that need to handle the event. + for (i = 0; i < arrTargetIndexesLength; i++) { + this.trackRepetition.childComponents[arrTargetIndexes[i]].handleKeyboardShortcut(tempEv); } } }, -- cgit v1.2.3 From 9cefcd17e5b1943685130553f6a4f62179df8936 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 17:48:31 -0700 Subject: FIx - hook up play button in timeline to live preview Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index af358468..12b481de 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -910,6 +910,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.eventManager.addEventListener("updatedID", this.handleLayerIdUpdate.bind(this), false); this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); + this.play_button.addEventListener("click", this.handlePlayButtonClick.bind(this), false); this.addPropertyChangeListener("currentDocument.model.domContainer", this); @@ -1085,6 +1086,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + handlePlayButtonClick:{ + value:function(ev){ + this.application.ninja.appModel.livePreview = !this.application.ninja.appModel.livePreview; + + if (this.application.ninja.appModel.livePreview) { + this.play_button.classList.remove("playbutton"); + this.play_button.classList.add("pausebutton"); + + } else { + this.play_button.classList.remove("pausebutton"); + this.play_button.classList.add("playbutton"); + } + } + }, + handleKeyframeShortcut:{ value:function(action){ var tempEv = {}; -- cgit v1.2.3