From 859dc176192af97166ead61c458b742853f04d1c Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 29 Nov 2007 16:49:18 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=BE=8C=E3=81=AE=E3=83=84=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E9=81=B8=E6=8A=9E=E3=81=95=E3=82=8C=E3=80=81?= =?UTF-8?q?=E4=B8=94=E3=81=A4=E5=AD=90=E5=AD=AB=E3=81=8C=E6=8A=98=E3=82=8A?= =?UTF-8?q?=E7=95=B3=E3=81=BE=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E7=8A=B6?= =?UTF-8?q?=E6=85=8B=E3=81=A7=E3=80=81=20=E3=81=9D=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=82=92=E9=96=89=E3=81=98=E3=81=9F=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=80=81=E4=BD=95=E3=82=82=E3=82=BF=E3=83=96=E3=81=8C=E9=81=B8?= =?UTF-8?q?=E6=8A=9E=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= =?UTF-8?q?=E7=8A=B6=E6=85=8B=E3=81=AB=20=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=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@1642 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 6412a647..2a7f2691 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -100,6 +100,23 @@ TreeStyleTabBrowser.prototype = { var selectNewTab = '_selectNewTab' in b.mTabContainer ? '_selectNewTab' : 'selectNewTab' ; // Fx3 / Fx2 + + /* 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. */ + var getter = b.__lookupGetter__('selectedTab'); + var setter = b.__lookupSetter__('selectedTab'); + eval('setter = '+setter.toSource().replace( + '{', + '{ if (!val) val = this.mTabContainer.lastChild;' + )); + /* We have to use both __defineSetter__ and __defineGetter__ + just in same time!! If we update only setter, + getter will be vanished. */ + b.__defineGetter__('selectedTab', getter); + b.__defineSetter__('selectedTab', setter); + + eval('b.mTabContainer.'+selectNewTab+' = '+ b.mTabContainer[selectNewTab].toSource().replace( '{',