thread_autoupdater.js: add interop event

This commit is contained in:
Jon 2024-02-26 18:39:41 +00:00 committed by 0
parent c07ae61548
commit 61b93aa927
1 changed files with 8 additions and 4 deletions

View File

@ -140,6 +140,13 @@ $().ready(() => {
} }
} }
$(document).on("thread_manual_refresh", () => {
if (secondsCounter >= 0) {
secondsCounter = 0
onTickFn()
}
})
let floaterLinkBox = null let floaterLinkBox = null
const onStateChangeFn = v => { const onStateChangeFn = v => {
onTickClean() onTickClean()
@ -156,10 +163,7 @@ $().ready(() => {
threadUpdateStatus.innerText = "…" threadUpdateStatus.innerText = "…"
threadUpdateLink.addEventListener("click", e => { threadUpdateLink.addEventListener("click", e => {
e.preventDefault() e.preventDefault()
if (secondsCounter >= 0) { $(document).trigger("thread_manual_refresh")
secondsCounter = 0
onTickFn()
}
}) })
threadUpdateLink.href = "#" threadUpdateLink.href = "#"
threadUpdateLink.appendChild(new Text("Refresh: ")) threadUpdateLink.appendChild(new Text("Refresh: "))