diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/js/forms.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/static/js/forms.ts b/static/js/forms.ts index 2916536..24c3d09 100644 --- a/static/js/forms.ts +++ b/static/js/forms.ts @@ -8,11 +8,11 @@ return console.warn("WARNING: Cannot persist form state due to cookie restrictions"); } - ["URLChangedCustomEvent", "DOMContentLoaded"].forEach(function (event) { + ["pageshow", "URLChangedCustomEvent", "DOMContentLoaded"].forEach(function (event) { self.addEventListener(event, function (event) { - const input = Array.prototype.slice.call(document.querySelectorAll("input")); - const select = Array.prototype.slice.call(document.querySelectorAll("select")); - const textarea = Array.prototype.slice.call(document.querySelectorAll("textarea")); + const input = Array.prototype.slice.call(document.querySelectorAll("form input")); + const select = Array.prototype.slice.call(document.querySelectorAll("form select")); + const textarea = Array.prototype.slice.call(document.querySelectorAll("form textarea")); const states = input.concat(select).concat(textarea); @@ -27,7 +27,7 @@ states[i].addEventListener("change", function (event) { - // console.log("INFO: STATE", event.target); + // console.log("INFO: STATE:", event.target); // console.log("INFO: ID:", event.target.id); // console.log("INFO: NAME:", event.target.name); // console.log("INFO: TYPE:", event.target.type); |