From 0b899ad6cec5e4626dfa32230be7c04d22d4f820 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Wed, 18 Jul 2012 12:23:54 -0700 Subject: The zoom slider position remembered between multi doc switch Signed-off-by: Kruti Shah --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 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 6cc08cdf..05b9335a 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -511,7 +511,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { set:function (newVal) { if (newVal !== this._millisecondsOffset) { - this.tempValue = newVal; + this.zoomValue = newVal; var tempValue = (1/newVal) * 1000000; newVal = tempValue; @@ -1115,7 +1115,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentLayersSelected = this.application.ninja.currentDocument.tlCurrentLayersSelected; this.currentElementsSelected = this.application.ninja.currentDocument.tlCurrentElementsSelected; this._currentDocumentUuid = this.application.ninja.currentDocument.uuid; - + this.millisecondsOffset = this.application.ninja.currentDocument.tlZoomSliderValue ; + this.zoom_slider.value = this.application.ninja.currentDocument.tlZoomSliderValue; // Are we only showing animated layers? if (this.application.ninja.currentDocument.boolShowOnlyAnimated) { @@ -1706,12 +1707,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { zoomTrackContainerWidthChange:{ value:function () { - this.tempValue = this.tempValue/1000; - this.tempValue *= 30; + if(this.application.ninja.currentDocument){ + this.application.ninja.currentDocument.tlZoomSliderValue = this.zoomValue; + + } + + this.zoomValue = this.zoomValue/1000; + this.zoomValue *= 30; - this.container_tracks.style.width = (this.tempValue * 80) + "px"; - this.master_track.style.width = (this.tempValue * 80) + "px"; - this.time_markers.style.width = (this.tempValue * 80) + "px"; + this.container_tracks.style.width = (this.zoomValue * 80) + "px"; + this.master_track.style.width = (this.zoomValue * 80) + "px"; + this.time_markers.style.width = (this.zoomValue * 80) + "px"; if (this.timeMarkerHolder) { this.time_markers.removeChild(this.timeMarkerHolder); } -- cgit v1.2.3 From 2805065a1f61241f25e1cf0d336dbb77d7e1dc01 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 20 Jul 2012 14:23:03 -0700 Subject: The zoom slider resets.Commented some code Signed-off-by: Kruti Shah --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 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 e037cccb..7581d15a 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1130,9 +1130,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentLayersSelected = this.application.ninja.currentDocument.tlCurrentLayersSelected; this.currentElementsSelected = this.application.ninja.currentDocument.tlCurrentElementsSelected; this._currentDocumentUuid = this.application.ninja.currentDocument.uuid; - this.millisecondsOffset = this.application.ninja.currentDocument.tlZoomSliderValue ; - this.zoom_slider.value = this.application.ninja.currentDocument.tlZoomSliderValue; - +// if(this.application.ninja.currentDocument.tlZoomSliderValue){ +// this.millisecondsOffset = this.application.ninja.currentDocument.tlZoomSliderValue ; +// if(this.zoom_slider){ +// this.zoom_slider.value = this.application.ninja.currentDocument.tlZoomSliderValue; +// } +// +// } // Are we only showing animated layers? if (this.application.ninja.currentDocument.boolShowOnlyAnimated) { // Fake a click. @@ -1707,7 +1711,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { zoomTrackContainerWidthChange:{ value:function () { - if(this.application.ninja.currentDocument){ + if(this.application.ninja.currentDocument && this.zoomValue){ this.application.ninja.currentDocument.tlZoomSliderValue = this.zoomValue; } @@ -1923,7 +1927,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleElementsRemoved:{ value:function (event) { - this.deleteLayers(event.detail); + + if(typeof(event.detail.length) === "undefined"){ + this.deleteLayers([event.detail]); + }else{ + this.deleteLayers(event.detail); + } } }, -- cgit v1.2.3