refresh downloads on cancel

This commit is contained in:
Zlatin Balevsky
2019-12-05 22:08:35 +00:00
parent 8d4af48eca
commit 4e32359718

View File

@@ -18,6 +18,7 @@ function cancelDownload(infoHash) {
if (this.readyState == 4 && this.status == 200) {
var downloadSpan = document.getElementById("download-"+infoHash);
downloadSpan.innerHTML = "";
refreshDownloader();
}
}
xmlhttp.open("POST", "/MuWire/Download", true);
@@ -56,8 +57,10 @@ function refreshDownloader() {
table += "<td>"+download.ETA+"</td>";
table += "<td>"+download.progress+"</td>";
table += "<td><span id='download-"+infoHash+"'><a href='#' onclick='window.cancelDownload(\""+infoHash+"\");return false;'>Cancel</a></span></td>";
if (download.state != "CANCELLED")
table += "<td><span id='download-"+infoHash+"'><a href='#' onclick='window.cancelDownload(\""+infoHash+"\");return false;'>Cancel</a></span></td>";
else
table += "<td></td>";
table += "</tr>";
}
table += "</tbody></table>";