From 2c071a8f606f776e5273137cfadff3cc7fe9969c Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 11 Oct 2019 01:01:15 -0400 Subject: [PATCH] clear update message on page switch --- views/honkpage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/views/honkpage.js b/views/honkpage.js index d14d095..eb05e3b 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -108,6 +108,12 @@ function hydrargs() { } return args } +function refreshupdate(msg) { + var el = document.querySelector("#refreshbox p span") + if (el) { + el.innerHTML = msg + } +} function refreshhonks(btn) { btn.innerHTML = "refreshing" btn.disabled = true @@ -118,7 +124,7 @@ function refreshhonks(btn) { var lenhonks = fillinhonks(xhr) btn.innerHTML = "refresh" btn.disabled = false - btn.parentElement.children[1].innerHTML = " " + lenhonks + " new" + refreshupdate(" " + lenhonks + " new") }) } function statechanger(evt) { @@ -159,6 +165,7 @@ function switchtopage(name, arg) { var args = hydrargs() get("/hydra?" + encode(args), fillinhonks) } + refreshupdate("") } function newpagestate(name, arg) { return { "name": name, "arg": arg }