diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index ff06443a..6d1fb5f7 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1747,23 +1747,29 @@ catch(e) { aEvent.target == aEvent.currentTarget) { this.initContextMenu(); } - if (!this.evaluateXPath( - 'not(self::*[local-name()="tooltip" or local-name()="panel"]) and '+ + if (!this.popupMenuShown && + !this.evaluateXPath( + 'local-name() = "tooltip" or local-name() ="panel" or '+ 'parent::*/ancestor-or-self::*[local-name()="popup" or local-name()="menupopup"]', aEvent.originalTarget, XPathResult.BOOLEAN_TYPE - ).booleanValue) + ).booleanValue) { + Application.console.log('show '+aEvent.originalTarget.localName+'#'+aEvent.originalTarget.id); this.popupMenuShown = true; + } return; case 'popuphiding': - if (!this.evaluateXPath( - 'not(self::*[local-name()="tooltip" or local-name()="panel"]) and '+ + if (this.popupMenuShown && + !this.evaluateXPath( + 'local-name() = "tooltip" or local-name() ="panel" or '+ 'parent::*/ancestor-or-self::*[local-name()="popup" or local-name()="menupopup"]', aEvent.originalTarget, XPathResult.BOOLEAN_TYPE - ).booleanValue) + ).booleanValue) { + Application.console.log('hide '+aEvent.originalTarget.id); this.popupMenuShown = false; + } return; case 'keydown':