split methods

This commit is contained in:
SHIMODA Hiroshi 2011-08-24 14:27:19 +09:00
parent 197911a031
commit 147812ff1c

View File

@ -2453,6 +2453,26 @@ TreeStyleTabBrowser.prototype = {
lastScrollX : -1, lastScrollX : -1,
lastScrollY : -1, lastScrollY : -1,
restoreLastScrollPosition : function TSTBrowser_restoreLastScrollPosition()
{
if (this.lastScrollX < 0 || this.lastScrollY < 0) return;
var lastX = this.lastScrollX;
var lastY = this.lastScrollY;
this.clearLastScrollPosition();
if (!this.smoothScrollTask &&
!this.scrollBox._smoothScrollTimer) { // don't restore scroll position if another scroll is already running.
let x = {}, y = {};
let scrollBoxObject = this.scrollBoxObject;
scrollBoxObject.getPosition(x, y);
if (x.value != lastX || y.value != lastY)
scrollBoxObject.scrollTo(lastX, lastY);
}
},
clearLastScrollPosition : function TSTBrowser_clearLastScrollPosition()
{
this.lastScrollX = -1;
this.lastScrollY = -1;
},
updateLastScrollPosition : function TSTBrowser_updateLastScrollPosition() updateLastScrollPosition : function TSTBrowser_updateLastScrollPosition()
{ {
if (!this.isVertical) return; if (!this.isVertical) return;
@ -3769,22 +3789,6 @@ TreeStyleTabBrowser.prototype = {
// restore scroll position when a tab is closed. // restore scroll position when a tab is closed.
this.restoreLastScrollPosition(); this.restoreLastScrollPosition();
}, },
restoreLastScrollPosition : function TSTBrowser_restoreLastScrollPosition()
{
if (this.lastScrollX < 0 || this.lastScrollY < 0) return;
var lastX = this.lastScrollX;
var lastY = this.lastScrollY;
this.lastScrollX = -1;
this.lastScrollY = -1;
if (!this.smoothScrollTask &&
!this.scrollBox._smoothScrollTimer) { // don't restore scroll position if another scroll is already running.
let x = {}, y = {};
let scrollBoxObject = this.scrollBoxObject;
scrollBoxObject.getPosition(x, y);
if (x.value != lastX || y.value != lastY)
scrollBoxObject.scrollTo(lastX, lastY);
}
},
onTabbarOverflow : function TSTBrowser_onTabbarOverflow(aEvent) onTabbarOverflow : function TSTBrowser_onTabbarOverflow(aEvent)
{ {