diff --git a/takhta.html b/takhta.html index 5da50b7..1dff4b3 100644 --- a/takhta.html +++ b/takhta.html @@ -806,6 +806,17 @@ let moveFile = event.target; if(moveFile.error === null) { + // reset the board + undoAll(); + moveFuture = []; + + let moveList = document.getElementById("movelist"); + + while(moveList.firstChild) { + moveList.removeChild(moveList.firstChild); + } + + // parse the file let rows = moveFile.result.split("\n"); for(let row of rows) { @@ -827,6 +838,10 @@ }); reader.readAsText(file); + + // clear the upload button + let hiddenLink = document.getElementById("moveupload"); + hiddenLink.value = ""; });