From 9e65c2c366968456e57a90cb6fc3eebd7b79b355 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Sep 2018 16:40:28 +0300 Subject: fix pm forms --- juick-server/src/main/assets/scripts.js | 5 ++--- juick-server/src/main/resources/templates/views/pm_inbox.html | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'juick-server/src') diff --git a/juick-server/src/main/assets/scripts.js b/juick-server/src/main/assets/scripts.js index 556fbf32..f2b7600e 100644 --- a/juick-server/src/main/assets/scripts.js +++ b/juick-server/src/main/assets/scripts.js @@ -701,8 +701,7 @@ ready(function () { }); }); } - var pmmsg = document.getElementById('pmmsg'); - if (pmmsg) { + document.querySelectorAll('.pmmsg').forEach(pmmsg => { pmmsg.addEventListener('submit', e => { e.preventDefault(); let formData = new FormData(pmmsg); @@ -726,7 +725,7 @@ ready(function () { alert(error.message); }); }); - } + }); document.querySelectorAll('.msg-menu').forEach(function (el) { el.addEventListener('click', function (e) { diff --git a/juick-server/src/main/resources/templates/views/pm_inbox.html b/juick-server/src/main/resources/templates/views/pm_inbox.html index 58ba538d..e82e120e 100644 --- a/juick-server/src/main/resources/templates/views/pm_inbox.html +++ b/juick-server/src/main/resources/templates/views/pm_inbox.html @@ -16,7 +16,7 @@