From b49b06ffb1e3c27034a735e8a8bb460ceee62f4b Mon Sep 17 00:00:00 2001 From: piro Date: Wed, 3 Dec 2008 13:05:01 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E4=B8=8A?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E6=B1=8E=E7=94=A8=E5=8C=96?= 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@3452 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 27 ++++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index b3ff6816..30d6a217 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1681,16 +1681,10 @@ TreeStyleTabBrowser.prototype = { this.collapseExpandSubtree(tab, tab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true'); } else if (!this.getTabFromEvent(aEvent)) { - var clickedPoint = aEvent[this.positionProp]; - Array.slice(this.mTabBrowser.mTabContainer.childNodes).some(function(aTab) { - var box = aTab.boxObject; - if (box[this.positionProp] > clickedPoint || - box[this.positionProp] + box[this.sizeProp] < clickedPoint) { - return false; - } + var tab = this.getTabFromTabbarEvent(aEvent); + if (tab) { this.mTabBrowser.selectedTab = aTab; - return true; - }, this); + } } else { return; @@ -1699,6 +1693,21 @@ TreeStyleTabBrowser.prototype = { aEvent.preventDefault(); aEvent.stopPropagation(); }, + getTabFromTabbarEvent : function(aEvent) + { + var tab = null; + var clickedPoint = aEvent[this.positionProp]; + Array.slice(this.mTabBrowser.mTabContainer.childNodes).some(function(aTab) { + var box = aTab.boxObject; + if (box[this.positionProp] > clickedPoint || + box[this.positionProp] + box[this.sizeProp] < clickedPoint) { + return false; + } + tab = aTab; + return true; + }, this); + return tab; + }, onTabMouseDown : function(aEvent) {