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 --- js/panels/Timeline/Layer.reel/Layer.js | 5 +++++ .../Timeline/TimelinePanel.reel/TimelinePanel.js | 26 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 776d5ec8..a8c22b2a 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -945,12 +945,14 @@ var Layer = exports.Layer = Montage.create(Component, { this.isMainCollapsed = false; } else { this.isMainCollapsed = true; + this.application.ninja.timeline.synchScrollbars(43); } this.triggerOutgoingBinding(); } }, handlePositionCollapserClick : { value: function(event) { + var myHeight = this.positionCollapser.element.offsetHeight; this.positionCollapser.bypassAnimation = false; this.bypassAnimation = false; this.layerData.bypassAnimation = false; @@ -958,12 +960,14 @@ var Layer = exports.Layer = Montage.create(Component, { this.isPositionCollapsed = false; } else { this.isPositionCollapsed = true; + this.application.ninja.timeline.synchScrollbars(myHeight); } this.triggerOutgoingBinding(); } }, handleStyleCollapserClick : { value: function(event) { + var myHeight = this.styleCollapser.element.offsetHeight; this.styleCollapser.bypassAnimation = false; this.bypassAnimation = false; this.layerData.bypassAnimation = false; @@ -971,6 +975,7 @@ var Layer = exports.Layer = Montage.create(Component, { this.isStyleCollapsed = false; } else { this.isStyleCollapsed = true; + this.application.ninja.timeline.synchScrollbars(myHeight); } this.triggerOutgoingBinding(); } 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