From 754525be82ff2ae1fbd4a7697fb17a10e198bfd2 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Mon, 29 Aug 2022 08:26:14 -0700 Subject: [PATCH] fix reset logic --- static/dream_web/index.html | 2 +- static/dream_web/index.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/dream_web/index.html b/static/dream_web/index.html index c145e5cd79..34ee69bad2 100644 --- a/static/dream_web/index.html +++ b/static/dream_web/index.html @@ -61,7 +61,7 @@ - +
diff --git a/static/dream_web/index.js b/static/dream_web/index.js index 8e6561ee76..ec9626f327 100644 --- a/static/dream_web/index.js +++ b/static/dream_web/index.js @@ -47,8 +47,10 @@ function loadFields(form) { } function clearFields(form) { - localStorage.clear() - location.reload() + localStorage.clear(); + let prompt = form.prompt.value; + form.reset(); + form.prompt.value = prompt; } async function generateSubmit(form) { @@ -116,7 +118,7 @@ window.onload = () => { document.querySelector("#generate-form").addEventListener('change', (e) => { saveFields(e.target.form); }); - document.querySelector("#reset").addEventListener('click', (e) => { + document.querySelector("#reset-seed").addEventListener('click', (e) => { document.querySelector("#seed").value = -1; saveFields(e.target.form); });