Skip to content

Commit 138e95c

Browse files
Feat: add keyup listener for subject field too
1 parent 6ad4ad9 commit 138e95c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gwynethllewelyn/postlocalstorage/styles/all/template/postlocalstorage_functions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@
110110
nIntervId = message.setInterval(updateStorage, 10000);
111111
}, { once: true }
112112
);
113+
// Same for the subject, I think:
114+
subject.addEventListener(
115+
"keyup",
116+
function() {
117+
message.addEventListener(unloadEvent, updateStorage);
118+
nIntervId = message.setInterval(updateStorage, 10000);
119+
}, { once: true }
120+
);
121+
113122
// When the form is submitted, delete the localStorage key/value pair.
114123
textarea.form.addEventListener("submit", function() {
115124
// ... except on Preview. We still want to keep the storage around during preview!

0 commit comments

Comments
 (0)