display a refresh link if the table needs updating

pull/34/head
Zlatin Balevsky 2019-12-07 20:23:22 +00:00
parent 2137d6d30b
commit 458dbec5fd
2 changed files with 5 additions and 2 deletions

View File

@ -24,10 +24,12 @@ function refreshStatus() {
hashingSpan.innerHTML = "";
var newRevision = xmlDoc.getElementsByTagName("Revision")[0].childNodes[0].nodeValue
var refreshDiv = document.getElementById("refresh-link")
if (newRevision > tableRevision) {
tableRevision = newRevision
// TODO: let the user know they can refresh the table
}
refreshDiv.innerHTML = "<a href='#' onclick='refreshTable();return false;'>Refresh</a>"
} else
refreshDiv.innerHTML = ""
}
}
xmlhttp.open("GET", "/MuWire/Files?section=status", true)

View File

@ -52,6 +52,7 @@ if (viewAs == null)
<div id="root"></div>
</ul>
<% } else { %>
<div id="refresh-link"></div>
<div id="table-wrapper">
<div id="table-scroll">
<div id="filesTable"></div>