don't update advanceSelectedTab twice
This commit is contained in:
parent
b7794809f2
commit
b665a8ca11
@ -1049,34 +1049,19 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
{
|
{
|
||||||
var b = this.mTabBrowser;
|
var b = this.mTabBrowser;
|
||||||
|
|
||||||
eval('b.mTabContainer.advanceSelectedTab = '+
|
var source = b.mTabContainer.advanceSelectedTab.toSource();
|
||||||
b.mTabContainer.advanceSelectedTab.toSource().replace(
|
if (source.indexOf('treeStyleTab.handleAdvanceSelectedTab') < 0) {
|
||||||
'{',
|
eval('b.mTabContainer.advanceSelectedTab = '+
|
||||||
<![CDATA[$&
|
source.replace(
|
||||||
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;
|
'{',
|
||||||
treeStyleTab._focusChangedByShortcut = TreeStyleTabService.accelKeyPressed;
|
<![CDATA[$&
|
||||||
if (treeStyleTab.canCollapseSubtree(this.selectedItem) &&
|
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;
|
||||||
treeStyleTab.getTreePref('focusMode') == treeStyleTab.kFOCUS_VISIBLE) {
|
if (treeStyleTab.handleAdvanceSelectedTab(arguments[0], arguments[1], this))
|
||||||
(function(aDir, aWrap, aSelf) {
|
return;
|
||||||
var nextTab = (aDir < 0) ? treeStyleTab.getPreviousVisibleTab(aSelf.selectedItem) : treeStyleTab.getNextVisibleTab(aSelf.selectedItem) ;
|
]]>
|
||||||
if (!nextTab && aWrap) {
|
)
|
||||||
nextTab = TreeStyleTabService.evaluateXPath(
|
);
|
||||||
'child::xul:tab[not(@'+TreeStyleTabService.kCOLLAPSED+'="true")]['+
|
}
|
||||||
(aDir < 0 ? 'last()' : '1' )+
|
|
||||||
']',
|
|
||||||
aSelf,
|
|
||||||
XPathResult.FIRST_ORDERED_NODE_TYPE
|
|
||||||
).singleNodeValue;
|
|
||||||
}
|
|
||||||
if (nextTab && nextTab != aSelf.selectedItem) {
|
|
||||||
aSelf._selectNewTab(nextTab, aDir, aWrap);
|
|
||||||
}
|
|
||||||
})(arguments[0], arguments[1], this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
]]>
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
eval('b.mTabContainer._notifyBackgroundTab = '+
|
eval('b.mTabContainer._notifyBackgroundTab = '+
|
||||||
b.mTabContainer._notifyBackgroundTab.toSource().replace(
|
b.mTabContainer._notifyBackgroundTab.toSource().replace(
|
||||||
@ -1668,6 +1653,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.removeTabStripAttribute('width');
|
this.removeTabStripAttribute('width');
|
||||||
this.removeTabStripAttribute('height');
|
this.removeTabStripAttribute('height');
|
||||||
this.removeTabStripAttribute('ordinal');
|
this.removeTabStripAttribute('ordinal');
|
||||||
|
this._endListenTabbarEvents();
|
||||||
|
|
||||||
this.mTabBrowser.mTabContainer.parentNode.classList.remove(this.kTABBAR_TOOLBAR);
|
this.mTabBrowser.mTabContainer.parentNode.classList.remove(this.kTABBAR_TOOLBAR);
|
||||||
},
|
},
|
||||||
@ -3192,6 +3178,30 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleAdvanceSelectedTab : function TSTBrowser_handleAdvanceSelectedTab(aDir, aWrap, aTabbar)
|
||||||
|
{
|
||||||
|
this._focusChangedByShortcut = TreeStyleTabService.accelKeyPressed;
|
||||||
|
|
||||||
|
if (!this.canCollapseSubtree(aTabbar.selectedItem) ||
|
||||||
|
this.getTreePref('focusMode') != this.kFOCUS_VISIBLE)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var nextTab = (aDir < 0) ? this.getPreviousVisibleTab(aTabbar.selectedItem) : this.getNextVisibleTab(aTabbar.selectedItem) ;
|
||||||
|
if (!nextTab && aWrap) {
|
||||||
|
nextTab = this.evaluateXPath(
|
||||||
|
'child::xul:tab[not(@'+this.kCOLLAPSED+'="true")]['+
|
||||||
|
(aDir < 0 ? 'last()' : '1' )+
|
||||||
|
']',
|
||||||
|
aTabbar,
|
||||||
|
XPathResult.FIRST_ORDERED_NODE_TYPE
|
||||||
|
).singleNodeValue;
|
||||||
|
}
|
||||||
|
if (nextTab && nextTab != aTabbar.selectedItem)
|
||||||
|
aTabbar._selectNewTab(nextTab, aDir, aWrap);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
onTabClick : function TSTBrowser_onTabClick(aEvent, aTab)
|
onTabClick : function TSTBrowser_onTabClick(aEvent, aTab)
|
||||||
{
|
{
|
||||||
aTab = aTab || this.getTabFromEvent(aEvent);
|
aTab = aTab || this.getTabFromEvent(aEvent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user