From f47aa8407b0155ad4c5096b3f3b16257426a9050 Mon Sep 17 00:00:00 2001 From: piro Date: Wed, 22 Jul 2009 03:35:54 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E7=B8=A6=E6=A8=AA=E3=82=92=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88?= =?UTF-8?q?=E3=81=9F=E6=99=82=E3=80=81=E3=82=BF=E3=83=96=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=81=B5=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=81=8B=E3=81=A9?= =?UTF-8?q?=E3=81=86=E3=81=8B=E3=81=AE=E7=8A=B6=E6=85=8B=E3=81=8C=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=95=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4778 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 72 +++++++++++---------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 2b820926..0135bc62 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -153,37 +153,6 @@ TreeStyleTabBrowser.prototype = { b.mTabContainer.addEventListener('scroll', this, true); - let (container) { - b.mTabContainer.removeAttribute('overflow'); // Firefox 3.0.x - container = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container'); - if (container) { - container.removeAttribute('overflow'); - - this.scrollBox.addEventListener('overflow', this, true); - this.scrollBox.addEventListener('underflow', this, true); - window.setTimeout(function(aBox, aTabBrowser, aContainer) { - aBox = document.getAnonymousElementByAttribute(aBox, 'anonid', 'scrollbox'); - if (aBox) aBox = document.getAnonymousNodes(aBox)[0]; - if ( - aBox && - ( - aBox.boxObject.width > aContainer.boxObject.width || - aBox.boxObject.height > aContainer.boxObject.height - ) - ) { - aTabBrowser.mTabContainer.setAttribute('overflow', true); // Firefox 3.0.x - aContainer.setAttribute('overflow', true); - } - else { - aTabBrowser.mTabContainer.removeAttribute('overflow'); // Firefox 3.0.x - aContainer.removeAttribute('overflow'); - } - }, 100, this.scrollBox, b, container); - } - container = null; - } - - /* Closing collapsed last tree breaks selected tab. To solve this problem, I override the setter to force to set a tab and forbid it becomes null. */ @@ -956,6 +925,7 @@ TreeStyleTabBrowser.prototype = { window.setTimeout(function(aSelf, aTabBrowser, aSplitter, aToggler) { delayedPostProcess(aSelf, aTabBrowser, aSplitter, aToggler); aSelf.updateTabbarState(); + aSelf.updateTabbarOverflow(); delayedPostProcess = null; }, 0, this, b, splitter, toggler); @@ -971,7 +941,8 @@ TreeStyleTabBrowser.prototype = { scrollInnerBox = null; allTabsButton = null; }, - updateTabbarState : function() + + updateTabbarState : function() { var b = this.mTabBrowser; var orient; @@ -1019,7 +990,40 @@ TreeStyleTabBrowser.prototype = { this.updateAllTabsIndent(); }, - + + updateTabbarOverflow : function() + { + var b = this.mTabBrowser; + b.mTabContainer.removeAttribute('overflow'); // Firefox 3.0.x + var container = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container'); + + if (!container) return; + + container.removeAttribute('overflow'); + + var scrollBox = this.scrollBox; + scrollBox.addEventListener('overflow', this, true); + scrollBox.addEventListener('underflow', this, true); + window.setTimeout(function() { + scrollBox = document.getAnonymousElementByAttribute(scrollBox, 'anonid', 'scrollbox'); + if (scrollBox) scrollBox = document.getAnonymousNodes(scrollBox)[0]; + if ( + scrollBox && + ( + scrollBox.boxObject.width > container.boxObject.width || + scrollBox.boxObject.height > container.boxObject.height + ) + ) { + b.mTabContainer.setAttribute('overflow', true); // Firefox 3.0.x + container.setAttribute('overflow', true); + } + else { + b.mTabContainer.removeAttribute('overflow'); // Firefox 3.0.x + container.removeAttribute('overflow'); + } + }, 100); + }, + destroy : function() { this.endAutoHide(); @@ -4029,7 +4033,7 @@ TreeStyleTabBrowser.prototype = { var borderNode = this.getTreePref( this.isVertical ? 'tabbar.fixed.vertical' : - 'tabbar.fixed.horizontal' + 'tabbar.fixed.horizontal' ) ? this.mTabBrowser.mStrip : document.getAnonymousElementByAttribute(this.mTabBrowser, 'class', this.kSPLITTER) ;