auto-refresh the files table if revision changed

This commit is contained in:
Zlatin Balevsky
2019-12-13 08:28:00 +00:00
parent b6411a555c
commit e075bfac55
2 changed files with 2 additions and 5 deletions

View File

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

View File

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