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; } },