From ee70014ccc8813bf4cab1c507b13b8e709353045 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 6 Jul 2009 15:36:43 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=82=BF=E3=83=96=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=82=AB=E3=82=B9=E5=88=B6=E5=BE=A1=E5=87=A6=E7=90=86=E3=81=8C?= =?UTF-8?q?=E5=83=8D=E3=81=8B=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=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@4638 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 21 ++++++++++++++++++--- content/treestyletab/treestyletabbrowser.js | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index ec987567..3610228c 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -526,8 +526,8 @@ var TreeStyleTabService = { return ( this.expandTwistyArea && this._expandTwistyAreaAllowance.every(function(aFunc) { - return aFunc(aTabBrowser); - }) + return aFunc.call(this, aTabBrowser); + }, this) ); }, expandTwistyArea : true, @@ -1160,9 +1160,24 @@ var TreeStyleTabService = { ); this.overrideExtensionsPreInit(); // hacks.js + + this.registerTabFocusAllowance(this.defaultTabFocusAllowance); }, preInitialized : false, - + + defaultTabFocusAllowance : function(aBrowser) + { + var tab = aBrowser.selectedTab; + return ( + !this.getPref('browser.tabs.selectOwnerOnClose') || + !tab.owner || + ( + aBrowser._removingTabs && + aBrowser._removingTabs.indexOf(tab.owner) > -1 + ) + ); + }, + init : function() { if (!('gBrowser' in window)) return; diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 7841be7a..31334b7f 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1516,8 +1516,8 @@ TreeStyleTabBrowser.prototype = { nextFocusedTab && b.selectedTab == tab && this._tabFocusAllowance.every(function(aFunc) { - return aFunc(b); - }) + return aFunc.call(this, b); + }, this) ) b.selectedTab = nextFocusedTab;