スクロール位置を必ず戻す処理を加えた
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@2680 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
59dcda24ea
commit
ce750c0090
@ -111,6 +111,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.addEventListener('dblclick', this, true);
|
b.mTabContainer.addEventListener('dblclick', this, true);
|
||||||
b.mTabContainer.addEventListener('mousedown', this, true);
|
b.mTabContainer.addEventListener('mousedown', this, true);
|
||||||
b.mTabContainer.addEventListener('select', this, true);
|
b.mTabContainer.addEventListener('select', this, true);
|
||||||
|
b.mTabContainer.addEventListener('scroll', this, true);
|
||||||
|
|
||||||
var selectNewTab = '_selectNewTab' in b.mTabContainer ? '_selectNewTab' : 'selectNewTab' ; // Fx3 / Fx2
|
var selectNewTab = '_selectNewTab' in b.mTabContainer ? '_selectNewTab' : 'selectNewTab' ; // Fx3 / Fx2
|
||||||
|
|
||||||
@ -193,11 +194,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
if (treeStyleTab.isVertical) {
|
if (ensureTabVisibleByTST(this.selectedItem)) {
|
||||||
window.setTimeout(ensureTabVisibleByTST, 0, this.selectedItem);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (ensureTabVisibleByTST(this.selectedItem)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
]]></>
|
]]></>
|
||||||
@ -792,6 +789,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.removeEventListener('dblclick', this, true);
|
b.mTabContainer.removeEventListener('dblclick', this, true);
|
||||||
b.mTabContainer.removeEventListener('mousedown', this, true);
|
b.mTabContainer.removeEventListener('mousedown', this, true);
|
||||||
b.mTabContainer.removeEventListener('select', this, true);
|
b.mTabContainer.removeEventListener('select', this, true);
|
||||||
|
b.mTabContainer.removeEventListener('scroll', this, true);
|
||||||
|
|
||||||
var tabContext = document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu');
|
var tabContext = document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu');
|
||||||
tabContext.removeEventListener('popupshowing', this, false);
|
tabContext.removeEventListener('popupshowing', this, false);
|
||||||
@ -974,6 +972,12 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
case 'TabClose':
|
case 'TabClose':
|
||||||
this.onTabRemoved(aEvent);
|
this.onTabRemoved(aEvent);
|
||||||
|
|
||||||
|
var x = {}, y = {};
|
||||||
|
var scrollBoxObject = this.mTabBrowser.mTabContainer.mTabstrip.scrollBoxObject;
|
||||||
|
scrollBoxObject.getPosition(x, y);
|
||||||
|
this.lastScrollX = x.value;
|
||||||
|
this.lastScrollY = y.value;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'TabMove':
|
case 'TabMove':
|
||||||
@ -1103,7 +1107,20 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case 'scroll':
|
case 'scroll':
|
||||||
this.redrawContentArea();
|
var node = aEvent.originalTarget;
|
||||||
|
if (node && node.ownerDocument == document) {
|
||||||
|
if (this.lastScrollX < 0 || this.lastScrollY < 0) return;
|
||||||
|
var x = {}, y = {};
|
||||||
|
var scrollBoxObject = this.mTabBrowser.mTabContainer.mTabstrip.scrollBoxObject;
|
||||||
|
scrollBoxObject.getPosition(x, y);
|
||||||
|
if (x.value != this.lastScrollX || y.value != this.lastScrollY)
|
||||||
|
scrollBoxObject.scrollTo(this.lastScrollX, this.lastScrollY);
|
||||||
|
this.lastScrollX = -1;
|
||||||
|
this.lastScrollY = -1;
|
||||||
|
}
|
||||||
|
else if (this.autoHideEnabled) {
|
||||||
|
this.redrawContentArea();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'load':
|
case 'load':
|
||||||
@ -1163,6 +1180,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
lastScrollX : -1,
|
||||||
|
lastScrollY : -1,
|
||||||
|
|
||||||
onTabAdded : function(aEvent)
|
onTabAdded : function(aEvent)
|
||||||
{
|
{
|
||||||
@ -3160,9 +3179,9 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
this.mTabBrowser.addEventListener('mousedown', this, true);
|
this.mTabBrowser.addEventListener('mousedown', this, true);
|
||||||
this.mTabBrowser.addEventListener('mouseup', this, true);
|
this.mTabBrowser.addEventListener('mouseup', this, true);
|
||||||
this.mTabBrowser.addEventListener('scroll', this, true);
|
|
||||||
this.mTabBrowser.addEventListener('resize', this, true);
|
this.mTabBrowser.addEventListener('resize', this, true);
|
||||||
this.mTabBrowser.addEventListener('load', this, true);
|
this.mTabBrowser.addEventListener('load', this, true);
|
||||||
|
this.mTabBrowser.mPanelContainer.addEventListener('scroll', this, true);
|
||||||
if (this.getTreePref('tabbar.autoShow.mousemove'))
|
if (this.getTreePref('tabbar.autoShow.mousemove'))
|
||||||
this.startListenMouseMove();
|
this.startListenMouseMove();
|
||||||
|
|
||||||
@ -3184,9 +3203,9 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
this.mTabBrowser.removeEventListener('mousedown', this, true);
|
this.mTabBrowser.removeEventListener('mousedown', this, true);
|
||||||
this.mTabBrowser.removeEventListener('mouseup', this, true);
|
this.mTabBrowser.removeEventListener('mouseup', this, true);
|
||||||
this.mTabBrowser.removeEventListener('scroll', this, true);
|
|
||||||
this.mTabBrowser.removeEventListener('resize', this, true);
|
this.mTabBrowser.removeEventListener('resize', this, true);
|
||||||
this.mTabBrowser.removeEventListener('load', this, true);
|
this.mTabBrowser.removeEventListener('load', this, true);
|
||||||
|
this.mTabBrowser.mPanelContainer.removeEventListener('scroll', this, true);
|
||||||
this.endListenMouseMove();
|
this.endListenMouseMove();
|
||||||
|
|
||||||
this.clearTabbarCanvas();
|
this.clearTabbarCanvas();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user