aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/src/main/static/scripts.js16
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 ef1c40d81..cca9545f1 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();
}