diff --git a/webui/src/main/js/download.js b/webui/src/main/js/download.js index 8d54c2cb..30bd9ddc 100644 --- a/webui/src/main/js/download.js +++ b/webui/src/main/js/download.js @@ -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 += ""+download.ETA+""; table += ""+download.progress+""; - table += "Cancel"; - + if (download.state != "CANCELLED") + table += "Cancel"; + else + table += ""; table += ""; } table += "";