From 8e480a19d9f6f09f54ac83fe67b044eaa1112879 Mon Sep 17 00:00:00 2001 From: piro Date: Sun, 29 Mar 2009 19:28:19 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=83=AB=E3=82=B9=E3=82=AF=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=83=B3=E3=83=A2=E3=83=BC=E3=83=89=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E6=99=82=E3=81=AB=E3=82=B7=E3=83=A7=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=83=88=E3=81=A7=E3=82=BF=E3=83=96=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=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@3952 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 18 +++++++++--------- content/treestyletab/treestyletabbrowser.js | 9 +++++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index e48de542..641d07f2 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1659,8 +1659,6 @@ catch(e) { sv.hideTabbar(); }, - keyEventListening : false, - startListenKeyEvents : function() { if (this.keyEventListening) return; @@ -1669,8 +1667,7 @@ catch(e) { window.addEventListener('keypress', this, true); this.keyEventListening = true; }, - - endListenKeyEvents : function() + endListenKeyEvents : function() { if (!this.keyEventListening) return; window.removeEventListener('keydown', this, true); @@ -1678,6 +1675,13 @@ catch(e) { window.removeEventListener('keypress', this, true); this.keyEventListening = false; }, + keyEventListening : false, + get shouldListenKeyEvents() + { + return this.getTreePref('tabbar.autoShow.accelKeyDown') || + this.getTreePref('tabbar.autoShow.tabSwitch') || + this.getTreePref('tabbar.autoShow.feedback'); + }, onTabbarResized : function(aEvent) { @@ -2072,11 +2076,7 @@ catch(e) { case 'extensions.treestyletab.tabbar.autoShow.feedback': if ( this.getTreePref('tabbar.autoHide.mode') && - ( - this.getTreePref('tabbar.autoShow.accelKeyDown') || - this.getTreePref('tabbar.autoShow.tabSwitch') || - this.getTreePref('tabbar.autoShow.feedback') - ) + this.shouldListenKeyEvents ) { this.startListenKeyEvents(); } diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 07a1a0c8..4d137e8d 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -3572,6 +3572,8 @@ TreeStyleTabBrowser.prototype = { this.mTabBrowser.mPanelContainer.addEventListener('scroll', this, true); if (this.shouldListenMouseMove) this.startListenMouseMove(); + if (this.mTabBrowser == gBrowser && this.shouldListenKeyEvents) + TreeStyleTabService.startListenKeyEvents(); this.clearTabbarCanvas(); this.updateTabbarTransparency(); @@ -3594,7 +3596,9 @@ TreeStyleTabBrowser.prototype = { this.mTabBrowser.removeEventListener('resize', this, true); this.mTabBrowser.removeEventListener('load', this, true); this.mTabBrowser.mPanelContainer.removeEventListener('scroll', this, true); - this.endListenMouseMove(); + this.endListenMouseMove(); + if (this.mTabBrowser == gBrowser) + TreeStyleTabService.endListenKeyEvents(); this.clearTabbarCanvas(); this.updateTabbarTransparency(); @@ -3622,7 +3626,8 @@ TreeStyleTabBrowser.prototype = { get shouldListenMouseMove() { return this.getTreePref('tabbar.autoShow.mousemove') || - this.getTreePref('tabbar.autoShow.accelKeyDown') || + this.getTreePref('tabbar.autoShow.accelKeyDown') || + this.getTreePref('tabbar.autoShow.tabSwitch') || this.getTreePref('tabbar.autoShow.feedback'); },