From dd13197c267b56e0706d0e9a9ba5313bf3b25d88 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 3 Sep 2009 07:31:49 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AE=E4=BD=8D=E7=BD=AE=E3=82=92=E5=A4=89=E6=9B=B4?= 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@5065 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 43 +++++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 97f74f17..ec485124 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -126,6 +126,23 @@ TreeStyleTabBrowser.prototype = { { var b = this.mTabBrowser; + let (splitter, toggler) { + splitter = document.getAnonymousElementByAttribute(b, 'class', this.kSPLITTER); + if (!splitter) { + splitter = document.createElement('splitter'); + splitter.setAttribute('class', this.kSPLITTER); + splitter.addEventListener('mousedown', this, true); + splitter.setAttribute('onmouseup', 'TreeStyleTabService.onTabbarResized(event);'); + splitter.setAttribute('state', 'open'); + splitter.appendChild(document.createElement('grippy')); + let ref = b.mPanelContainer; + ref.parentNode.insertBefore(splitter, ref); + toggler = document.createElement('spacer'); + toggler.setAttribute('class', this.kTABBAR_TOGGLER); + b.mStrip.parentNode.insertBefore(toggler, b.mStrip); + } + } + this.initTabbar(); b.addEventListener('TabOpen', this, true); @@ -535,8 +552,7 @@ TreeStyleTabBrowser.prototype = { this.ObserverService.addObserver(this, 'TreeStyleTab:collapseExpandAllSubtree', false); this.addPrefListener(this); - // TreeStyleTabBrowserAutoHide fails to initialize before the tab bar is completely initialized!!! - this.autoHide = new TreeStyleTabBrowserAutoHide(this); + this.autoHide; b = null; }, @@ -706,19 +722,6 @@ TreeStyleTabBrowser.prototype = { var splitter = document.getAnonymousElementByAttribute(b, 'class', this.kSPLITTER); var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER); - if (!splitter) { - splitter = document.createElement('splitter'); - splitter.setAttribute('class', this.kSPLITTER); - splitter.addEventListener('mousedown', this, true); - splitter.setAttribute('onmouseup', 'TreeStyleTabService.onTabbarResized(event);'); - splitter.setAttribute('state', 'open'); - splitter.appendChild(document.createElement('grippy')); - var ref = b.mPanelContainer; - ref.parentNode.insertBefore(splitter, ref); - toggler = document.createElement('spacer'); - toggler.setAttribute('class', this.kTABBAR_TOGGLER); - b.mStrip.parentNode.insertBefore(toggler, b.mStrip); - } // Tab Mix Plus var scrollFrame = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-frame'); @@ -983,7 +986,7 @@ TreeStyleTabBrowser.prototype = { destroy : function() { this.autoHide.destroy(); - delete this.autoHide; + delete this._autoHide; var b = this.mTabBrowser; @@ -3483,7 +3486,13 @@ TreeStyleTabBrowser.prototype = { } }, -/* show/hide tab bar (backward compatibility) */ +/* show/hide tab bar */ + get autoHide() + { + return this._autoHide || (this._autoHide = new TreeStyleTabBrowserAutoHide(this)); + }, + + // for backward compatibility get tabbarShown() { return this.autoHide.tabbarShown; }, set tabbarShown(aValue) { return this.autoHide.tabbarShown = aValue; }, get tabbarExpanded() { return this.autoHide.tabbarExpanded; },