From 61df6c5c8ac39ec59364588d5074f008b77b7c50 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Fri, 14 Jan 2011 00:05:28 +0900 Subject: [PATCH] the tooltip on a tab was wrongly shown with the text for the twisty even if the event is fired not on the twisty --- content/treestyletab/treestyletabbrowser.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 02cffd42..8e359a7b 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -380,7 +380,6 @@ TreeStyleTabBrowser.prototype = { if (!this.isFloating && 'tabutils' in window) tabContainer.addEventListener('DOMAttrModified', this, true); // Tab Utilities tabContainer.addEventListener('mouseover', this, true); - tabContainer.addEventListener('mouseout', this, true); tabContainer.addEventListener('dblclick', this, true); tabContainer.addEventListener('select', this, true); tabContainer.addEventListener('scroll', this, true); @@ -1543,7 +1542,6 @@ TreeStyleTabBrowser.prototype = { if (!this.isFloating && 'tabutils' in window) b.mTabContainer.removeEventListener('DOMAttrModified', this, true); // Tab Utilites tabContainer.removeEventListener('mouseover', this, true); - tabContainer.removeEventListener('mouseout', this, true); tabContainer.removeEventListener('dblclick', this, true); tabContainer.removeEventListener('select', this, true); tabContainer.removeEventListener('scroll', this, true); @@ -1938,15 +1936,17 @@ TreeStyleTabBrowser.prototype = { case 'popupshowing': return this.onPopupShowing(aEvent) - case 'mouseover': - if (this.isEventFiredOnTwisty(aEvent)) - aEvent.target.setAttribute(this.kTWISTY_HOVER, true); - return; - - case 'mouseout': - if (this.isEventFiredOnTwisty(aEvent)) - aEvent.target.removeAttribute(this.kTWISTY_HOVER); + let (tab = aEvent.target) { + if (tab.__treestyletab__twistyHoverTimer) + window.clearTimeout(tab.__treestyletab__twistyHoverTimer); + if (this.isEventFiredOnTwisty(aEvent)) + tab.__treestyletab__twistyHoverTimer = window.setTimeout(function(aSelf) { + tab.setAttribute(aSelf.kTWISTY_HOVER, true); + }, 0, this); + else + tab.removeAttribute(this.kTWISTY_HOVER); + } return; case 'overflow':