From dfc2edef0962ec663cf451aff325d3431f45a8b1 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 23 Mar 2010 18:09:55 +0000 Subject: [PATCH] =?UTF-8?q?getParentTab=E3=81=A7=E7=84=A1=E9=99=90?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=97=E3=81=AB=E9=99=A5=E3=82=8B=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E6=80=A7=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=EF=BC=9F?= 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@6411 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- modules/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/utils.js b/modules/utils.js index 2baac84b..6fac3313 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -725,7 +725,7 @@ var TreeStyleTabUtils = { getTabbarFromEvent : function TSTUtils_getTabbarFromEvent(aEvent) { return this.evaluateXPath( - 'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ")]', + 'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ") or (local-name()="tabs" and @tabbrowser)]', aEvent.originalTarget || aEvent.target, Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE ).singleNodeValue; @@ -1261,11 +1261,12 @@ var TreeStyleTabUtils = { if (!aTab) return null; var id = aTab.getAttribute(this.kID); if (!id) return null; // not initialized yet - return this.evaluateXPath( + var tab = this.evaluateXPath( 'parent::*/child::xul:tab[contains(concat("|", @'+this.kCHILDREN+', "|"), "|'+id+'|")]', aTab, Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE ).singleNodeValue; + return tab == aTab ? null : tab ; }, getRootTab : function TSTUtils_getRootTab(aTab) /* PUBLIC API */