aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/static/scripts.js
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/static/scripts.js')
-rw-r--r--juick-www/src/main/static/scripts.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 48c99287..a12ec709 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -531,6 +531,10 @@ function openDialog(html) {
}
function closeDialog() {
+ let draft = document.querySelector('#newmessage textarea');
+ if (draft) {
+ window.draft = draft.value;
+ }
document.querySelector('#dialogb').remove();
document.querySelector('#dialogt').remove();
}
@@ -629,7 +633,7 @@ function getTags() {
credentials: 'same-origin'
})
.then(response => {
- return response.json()
+ return response.json();
})
.then(json => {
let tags = json.map(t => t.tag);
@@ -822,6 +826,9 @@ ready(function () {
if (newMessageBlock) {
newMessageBlock.addEventListener('submit', newMessage);
let ta = newMessageBlock.querySelector('textarea');
+ if (window.draft) {
+ ta.innerHTML = window.draft;
+ }
ta.addEventListener('keypress', function (e) {
postformListener(e.target, e);
});