diff options
author | Vitaly Takmazov | 2016-07-28 11:39:15 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-28 11:39:15 +0300 |
commit | 1e729a0787540b70ce0fdb160230115a350b1836 (patch) | |
tree | 7dcabdb5e22c7ec114b7ca45c68910d4e835fae1 /juick-www/src/main | |
parent | 4b570404676301c443f56d66f9781bf6980445aa (diff) |
www: fix wsIncomingReply handlers
Diffstat (limited to 'juick-www/src/main')
-rw-r--r-- | juick-www/src/main/static/scripts.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index ef1c40d8..cca9545f 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -74,14 +74,8 @@ function wsIncomingReply(msg) { var li = document.createElement('li'); li.setAttribute('class', 'msg reply-new'); li.setAttribute('id', msg.rid); - li.addEventListener('click', function (e) { - newReply(this); - e.preventDefault(); - }); - li.addEventListener('mouseover', function (e) { - newReply(this); - e.preventDefault(); - }); + li.addEventListener('click', newReply); + li.addEventListener('mouseover', newReply); var msgAvatar = document.createElement('div'); msgAvatar.setAttribute('class', 'msg-avatar'); var msgAvatarLink = document.createElement('a'); @@ -156,8 +150,8 @@ function wsIncomingReply(msg) { function newReply(li) { li.classList.remove('reply-new'); - li.removeEventListener('click'); - li.removeEventListener('mouseover'); + li.removeEventListener('click', this); + li.removeEventListener('mouseover', this); updateRepliesCounter(); } @@ -165,7 +159,7 @@ function onclickNextReply() { var li = document.querySelector('#replies>li.reply-new:first'); if (li.length) { li.classList.remove('reply-new'); - li.removeEventListener('click'); + li.removeEventListener('click', this); li.childNodes[0].scrollIntoView(); updateRepliesCounter(); } |