aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-02-02 20:10:06 -0500
committertdro <tdro@noreply.example.com>2024-02-02 20:10:06 -0500
commit78855c919aa825c5fff2c99cd137cb2eee6878a4 (patch)
treee100b55ec6527fa09d40cad5ef6e91be5666983e /static
parent9508719b77269d1a9a67aab4b9c9070b2b3d6ebd (diff)
downloadcanory-78855c919aa825c5fff2c99cd137cb2eee6878a4.tar.gz
canory-78855c919aa825c5fff2c99cd137cb2eee6878a4.tar.bz2
canory-78855c919aa825c5fff2c99cd137cb2eee6878a4.zip
static/js/forms: Scope to inside forms
Persist pageshow
Diffstat (limited to 'static')
-rw-r--r--static/js/forms.ts10
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);