thread_autoupdater.js: add interop event

This commit is contained in:
Jon 2024-02-26 18:39:41 +00:00
parent a5969f4e80
commit 7ea730f14f
No known key found for this signature in database
GPG Key ID: 0175F5C9B8E9F984
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
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: "))