From 3e87cc6a73fbfc165f81d5f7a3d7d1f76e7feb9a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 1 Nov 2017 01:57:08 +0300 Subject: www: /post should not throw if img or attach is present --- juick-www/src/main/static/scripts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/static') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index 7dc24dd2..e33d1929 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -292,7 +292,9 @@ function newMessage(evt) { document.querySelectorAll('#newmessage .dialogtxt').forEach(t => { t.remove(); }); - if (document.querySelector('#newmessage textarea').value.length == 0) { + if (document.querySelector('#newmessage textarea').value.length == 0 + && document.querySelector('#newmessage .img').value.length == 0 + && !document.querySelector('#newmessage input[type="file"]')) { document.querySelector('#newmessage').insertAdjacentHTML('afterbegin', `
${i18n('postForm.pleaseInputMessageText')}
`); evt.preventDefault(); } -- cgit v1.2.3