mirror of https://github.com/zlatinb/muwire
display a refresh link if the table needs updating
parent
2137d6d30b
commit
458dbec5fd
|
@ -24,10 +24,12 @@ 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
|
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)
|
xmlhttp.open("GET", "/MuWire/Files?section=status", true)
|
||||||
|
|
|
@ -52,6 +52,7 @@ 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>
|
||||||
|
|
Loading…
Reference in New Issue