aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-08-30 09:37:16 +0300
committerGravatar Vitaly Takmazov2017-08-30 09:37:16 +0300
commit9a625f21791c3d80380433e96f36cfe05f7485df (patch)
tree8da117c199fb77ada8db9e9412cd5f631c3890bb
parent49b10c518986ffd2f4787659411420155c974cc9 (diff)
www: fix upload button
-rw-r--r--juick-www/src/main/static/scripts.js35
1 files changed, 18 insertions, 17 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 2daaa8c0..244c83c6 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -787,26 +787,27 @@ ready(function () {
e.preventDefault();
});
}
- var newMessageBlock = document.getElementById('newmessage');
- if (newMessageBlock) {
- var form = newMessageBlock.parentNode;
- form.addEventListener('submit', newMessage);
- newMessageBlock.querySelector('textarea').addEventListener('click', function (e) {
- var parent = e.target.parentNode;
- e.target.addEventListener('keypress', function (e) {
- postformListener(e.target, e);
- });
- });
- newMessageBlock.querySelector('a').addEventListener('click', function (e) {
- attachMessagePhoto(e.target);
- });
- }
+
var post = document.getElementById('post');
post.addEventListener('click', (e) => {
openPostDialog();
- var ta = document.querySelector('#newmessage textarea');
- ta.style.minHeight = '70px';
- ta.focus();
+ var newMessageBlock = document.getElementById('newmessage');
+ if (newMessageBlock) {
+ var form = newMessageBlock.parentNode;
+ form.addEventListener('submit', newMessage);
+ let ta = newMessageBlock.querySelector('textarea');
+ ta.addEventListener('click', function (e) {
+ var parent = e.target.parentNode;
+ e.target.addEventListener('keypress', function (e) {
+ postformListener(e.target, e);
+ });
+ });
+ ta.style.minHeight = '70px';
+ ta.focus();
+ newMessageBlock.querySelector('a').addEventListener('click', function (e) {
+ attachMessagePhoto(e.target);
+ });
+ }
e.preventDefault();
});
document.querySelectorAll('article').forEach(function (article) {