From 84cc3d16ed635561e85adecf87e2c2fb4d15d612 Mon Sep 17 00:00:00 2001 From: j433866 Date: Fri, 10 May 2019 16:54:28 +0100 Subject: [PATCH] Fix close tab buttons not working in old firefox. --- src/web/InputWaiter.mjs | 3 ++- src/web/Manager.mjs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/InputWaiter.mjs b/src/web/InputWaiter.mjs index d7871c41..7a19f75a 100644 --- a/src/web/InputWaiter.mjs +++ b/src/web/InputWaiter.mjs @@ -833,6 +833,7 @@ class InputWaiter { newTabButtonIcon.innerText = "clear"; newTabButton.appendChild(newTabButtonIcon); + newTabButton.addEventListener("click", this.removeTabClick.bind(this)); newTab.appendChild(newTabContent); newTab.appendChild(newTabButton); @@ -1179,7 +1180,7 @@ class InputWaiter { if (!mouseEvent.target) { return; } - const tabNum = mouseEvent.target.parentElement.parentElement.getAttribute("inputNum"); + const tabNum = mouseEvent.target.closest("button").parentElement.getAttribute("inputNum"); if (tabNum) { this.removeInput(parseInt(tabNum, 10)); } diff --git a/src/web/Manager.mjs b/src/web/Manager.mjs index 533afb5a..390e64dd 100755 --- a/src/web/Manager.mjs +++ b/src/web/Manager.mjs @@ -162,7 +162,6 @@ class Manager { document.getElementById("btn-next-input-tab").addEventListener("click", this.input.changeTabRight.bind(this.input)); document.getElementById("btn-go-to-input-tab").addEventListener("click", this.input.goToTab.bind(this.input)); document.getElementById("btn-find-input-tab").addEventListener("click", this.input.findTab.bind(this.input)); - this.addDynamicListener("#input-tabs li .btn-close-tab i", "click", this.input.removeTabClick, this.input); this.addDynamicListener("#input-tabs li .input-tab-content", "click", this.input.changeTabClick, this.input); document.getElementById("input-show-pending").addEventListener("change", this.input.filterTabSearch.bind(this.input)); document.getElementById("input-show-loading").addEventListener("change", this.input.filterTabSearch.bind(this.input));