From 7ea730f14fa6e58b2fe659328776a4c950a5d864 Mon Sep 17 00:00:00 2001 From: Jon <134811123+jonsmy@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:39:41 +0000 Subject: [PATCH] thread_autoupdater.js: add interop event --- js/lcn/thread_autoupdater.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/lcn/thread_autoupdater.js b/js/lcn/thread_autoupdater.js index 4bc68c6c..b4483a56 100644 --- a/js/lcn/thread_autoupdater.js +++ b/js/lcn/thread_autoupdater.js @@ -140,6 +140,13 @@ $().ready(() => { } } + $(document).on("thread_manual_refresh", () => { + if (secondsCounter >= 0) { + secondsCounter = 0 + onTickFn() + } + }) + let floaterLinkBox = null const onStateChangeFn = v => { onTickClean() @@ -156,10 +163,7 @@ $().ready(() => { threadUpdateStatus.innerText = "…" threadUpdateLink.addEventListener("click", e => { e.preventDefault() - if (secondsCounter >= 0) { - secondsCounter = 0 - onTickFn() - } + $(document).trigger("thread_manual_refresh") }) threadUpdateLink.href = "#" threadUpdateLink.appendChild(new Text("Refresh: "))