From 4071e166caa7cbfa3bc79305d43bec953dcee965 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 25 Mar 2010 10:19:29 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=83=97=E3=83=AA=E3=83=83=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E3=83=80=E3=83=96=E3=83=AB=E3=82=AF=E3=83=AA=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=A7=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E5=B9=85=E3=83=BB=E9=AB=98=E3=81=95=E3=82=92=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=80=A4=E3=81=AB=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= 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@6446 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 43 +++++++++++++++++---- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 82d17988..a8e5047e 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1088,6 +1088,7 @@ TreeStyleTabBrowser.prototype = { try { splitter.removeEventListener('mouseup', this, false); splitter.removeEventListener('click', this, false); + splitter.removeEventListener('dblclick', this, false); } catch(e) { } @@ -1108,6 +1109,7 @@ TreeStyleTabBrowser.prototype = { splitter.addEventListener('mouseup', this, false); splitter.addEventListener('click', this, false); + splitter.addEventListener('dblclick', this, false); var ref = this.mTabBrowser.mPanelContainer; ref.parentNode.insertBefore(splitter, ref); @@ -1203,6 +1205,25 @@ TreeStyleTabBrowser.prototype = { } }, + resetTabbarSize : function TSTBrowser_resetTabbarSize() + { + if (!this.isVertical) { + this.clearTreePref('tabbar.height'); + if (this.placeholder) { + let tabs = this.mTabBrowser.mTabContainer; + tabs.removeAttribute('height'); + this.placeholder.height = tabs.boxObject.height; + this.updateFloatingTabbar(); + } + } + else { + if (!this.autoHide.expanded) + this.clearTreePref('tabbar.shrunkenWidth'); + else + this.clearTreePref('tabbar.width'); + } + }, + updateTabbarOverflow : function TSTBrowser_updateTabbarOverflow() { var b = this.mTabBrowser; @@ -2555,13 +2576,21 @@ TreeStyleTabBrowser.prototype = { onDblClick : function TSTBrowser_onDblClick(aEvent) { - var tab = this.getTabFromEvent(aEvent); - if (tab && - this.hasChildTabs(tab) && - this.getTreePref('collapseExpandSubtree.dblclick')) { - this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true'); - aEvent.preventDefault(); - aEvent.stopPropagation(); + switch (aEvent.currentTarget.localName) + { + case 'splitter': + return this.resetTabbarSize(); + + default: + let tab = this.getTabFromEvent(aEvent); + if (tab && + this.hasChildTabs(tab) && + this.getTreePref('collapseExpandSubtree.dblclick')) { + this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true'); + aEvent.preventDefault(); + aEvent.stopPropagation(); + } + return; } },