From a0aa363203a31bdb3a755156cef2b4447f086d2b Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 27 Dec 2017 02:01:17 +0000 Subject: [PATCH] Download filenames now persist --- src/web/OutputWaiter.js | 6 +++--- src/web/html/index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/OutputWaiter.js b/src/web/OutputWaiter.js index 93cc351..ca1f360 100755 --- a/src/web/OutputWaiter.js +++ b/src/web/OutputWaiter.js @@ -135,10 +135,10 @@ OutputWaiter.prototype.closeFile = function() { * Handler for file download events. */ OutputWaiter.prototype.downloadFile = function() { - const filename = window.prompt("Please enter a filename:", "download.dat"); - const file = new File([this.dishBuffer], filename); + this.filename = window.prompt("Please enter a filename:", this.filename || "download.dat"); + const file = new File([this.dishBuffer], this.filename); - if (filename) FileSaver.saveAs(file, filename, false); + if (this.filename) FileSaver.saveAs(file, this.filename, false); }; diff --git a/src/web/html/index.html b/src/web/html/index.html index a132aeb..c8857ff 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -226,7 +226,7 @@
- +
to