From c602588f1100f358cff28a822c4136e3e38f3dda Mon Sep 17 00:00:00 2001 From: MaxKoll <39014485+MaxKoll@users.noreply.github.com> Date: Mon, 8 Oct 2018 14:01:46 +0200 Subject: Revert "Fix in-tab close button behavior" --- application/palemoon/base/content/tabbrowser.xml | 142 ++++++++++------------- 1 file changed, 61 insertions(+), 81 deletions(-) diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index d9cff276a..93818e290 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -4296,94 +4296,17 @@ event.originalTarget.localName != "box") return; - // See comments in the "mousedown" and "click" event handlers of the - // "tabbrowser-tabs" binding. + // See hack note in the tabbrowser-close-tab-button binding if (!this._blockDblClick) BrowserOpenTab(); - else - this.flagBlockedOpenTabAfterDblClick = true; event.preventDefault(); ]]> - - - - + 1 || !this._closeWindowWithLastTab) this.tabbrowser.removeTab(event.target, {animate: true, byMouse: true}); @@ -4756,6 +4679,63 @@ + 1 && !this._ignoredClick) { + this._ignoredClick = true; + return; + } + + // Reset the "ignored click" flag + this._ignoredClick = false; + + tabContainer.tabbrowser.removeTab(bindingParent, {animate: true, byMouse: true}); + tabContainer._blockDblClick = true; + + /* XXXmano hack (see bug 343628): + * Since we're removing the event target, if the user + * double-clicks this button, the dblclick event will be dispatched + * with the tabbar as its event target (and explicit/originalTarget), + * which treats that as a mouse gesture for opening a new tab. + * In this context, we're manually blocking the dblclick event + * (see dblclick handler). + */ + var clickedOnce = false; + function enableDblClick(event) { + var target = event.originalTarget; + if (target.className == 'tab-close-button') + target._ignoredClick = true; + if (!clickedOnce) { + clickedOnce = true; + return; + } + tabContainer._blockDblClick = false; + tabContainer.removeEventListener("click", enableDblClick, true); + } + tabContainer.addEventListener("click", enableDblClick, true); + ]]> + + + // for the one-close-button case + event.stopPropagation(); + + event.stopPropagation(); -- cgit v1.2.3