From 94757e275a79dad7d9fdc083ad94e84710261c32 Mon Sep 17 00:00:00 2001 From: MaxKoll <39014485+MaxKoll@users.noreply.github.com> Date: Mon, 8 Oct 2018 14:29:20 +0200 Subject: Fix in-tab close button behavior Fixes #775 (non-responsiveness when closing multiple tabs by rapidly clicking in-tab close buttons). --- application/palemoon/base/content/tabbrowser.xml | 124 ++++++++++++----------- 1 file changed, 63 insertions(+), 61 deletions(-) (limited to 'application/palemoon/base/content') diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 93818e290..19e1d4659 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -4296,17 +4296,76 @@ event.originalTarget.localName != "box") return; - // See hack note in the tabbrowser-close-tab-button binding + // See comments in the "mousedown" and "click" event handlers of the + // tabbrowser-tabs binding. if (!this._blockDblClick) BrowserOpenTab(); event.preventDefault(); ]]> - + + + + 1 || !this._closeWindowWithLastTab) this.tabbrowser.removeTab(event.target, {animate: true, byMouse: true}); @@ -4679,63 +4738,6 @@ - 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