update compatibility codes for Tab Mix Plus

This commit is contained in:
SHIMODA Hiroshi 2011-05-26 11:02:34 +09:00
parent 91ee4592dc
commit d67ecd7d80
2 changed files with 13 additions and 4 deletions

View File

@ -75,8 +75,12 @@ var TreeStyleTabWindowHelper = {
var strip = this.service.getTabStrip(aObserver) || var strip = this.service.getTabStrip(aObserver) ||
gBrowser.mStrip // fallback to the default strip, for Tab Mix Plus; gBrowser.mStrip // fallback to the default strip, for Tab Mix Plus;
if (aObserver.tabContainer && // Firefox 4.0 or later
aObserver.tabContainer.tabbrowser == aObserver) { // Firefox 4.0 or later if (
aObserver.tabContainer &&
aObserver.tabContainer.tabbrowser == aObserver &&
this.service.isGecko2 // tabbar.tabbrowser can be defined by addons like Tab Mix Plus.
) {
aObserver = aObserver.tabContainer; aObserver = aObserver.tabContainer;
} }

View File

@ -974,6 +974,9 @@ TreeStyleTabBrowser.prototype = {
scrollFrame = d.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-frame') || scrollFrame = d.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-frame') ||
d.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'scroll-tabs-frame'); d.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'scroll-tabs-frame');
newTabBox = d.getAnonymousElementByAttribute(b.mTabContainer, 'id', 'tabs-newbutton-box'); newTabBox = d.getAnonymousElementByAttribute(b.mTabContainer, 'id', 'tabs-newbutton-box');
let newTabButton = document.getElementById('new-tab-button');
if (newTabButton && newTabButton.parentNode == b.tabContainer._container)
newTabBox = newTabButton;
tabBarMode = this.getPref('extensions.tabmix.tabBarMode'); tabBarMode = this.getPref('extensions.tabmix.tabBarMode');
} }
@ -1017,7 +1020,8 @@ TreeStyleTabBrowser.prototype = {
d.getAnonymousNodes(scrollFrame)[0].removeAttribute('flex'); d.getAnonymousNodes(scrollFrame)[0].removeAttribute('flex');
scrollFrame.parentNode.orient = scrollFrame.parentNode.orient =
scrollFrame.orient = 'vertical'; scrollFrame.orient = 'vertical';
newTabBox.orient = 'horizontal'; if (newTabBox)
newTabBox.orient = 'horizontal';
if (tabBarMode == 2) if (tabBarMode == 2)
this.setPref('extensions.tabmix.tabBarMode', 1); this.setPref('extensions.tabmix.tabBarMode', 1);
} }
@ -1105,7 +1109,8 @@ TreeStyleTabBrowser.prototype = {
d.getAnonymousNodes(scrollFrame)[0].setAttribute('flex', 1); d.getAnonymousNodes(scrollFrame)[0].setAttribute('flex', 1);
scrollFrame.parentNode.orient = scrollFrame.parentNode.orient =
scrollFrame.orient = 'horizontal'; scrollFrame.orient = 'horizontal';
newTabBox.orient = 'vertical'; if (newTabBox)
newTabBox.orient = 'vertical';
} }
if (toolboxContainer) if (toolboxContainer)