diff --git a/src/web/Manager.mjs b/src/web/Manager.mjs index 23a035af..1f32665e 100755 --- a/src/web/Manager.mjs +++ b/src/web/Manager.mjs @@ -210,7 +210,7 @@ class Manager { document.getElementById("output-num-results").addEventListener("change", this.output.filterTabSearch.bind(this.output)); document.getElementById("output-num-results").addEventListener("keyup", this.output.filterTabSearch.bind(this.output)); document.getElementById("output-filter-refresh").addEventListener("click", this.output.filterTabSearch.bind(this.output)); - // this.addDynamicListener(".output-filter-result", "click", this.output.filterItemClick, this.output); + this.addDynamicListener(".output-filter-result", "click", this.output.filterItemClick, this.output); // Options diff --git a/src/web/OutputWaiter.mjs b/src/web/OutputWaiter.mjs index fffcc4fd..5f8d44ee 100755 --- a/src/web/OutputWaiter.mjs +++ b/src/web/OutputWaiter.mjs @@ -1333,6 +1333,21 @@ class OutputWaiter { resultsList.appendChild(newListItem); } } + + /** + * Handler for clicking on a filter result. + * Changes to the clicked output + * + * @param {event} e + */ + filterItemClick(e) { + if (!e.target) return; + const inputNum = parseInt(e.target.getAttribute("inputNum"), 10); + if (inputNum <= 0) return; + + $("#output-tab-modal").modal("hide"); + this.changeTab(inputNum, this.app.options.syncTabs); + } } export default OutputWaiter;