aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/static
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/static')
-rw-r--r--juick-www/src/main/static/scripts.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 1c6e764e..6088da97 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -140,10 +140,10 @@ function wsIncomingReply(msg) {
if (msg.replyto > 0) {
var p = document.getElementById(msg.replyto);
- li.style.marginLeft = p.style.marginLeft + '20px';
+ li.style.marginLeft = parseInt(p.style.marginLeft) + 20 + 'px';
p.parentNode.insertBefore(li, p.nextSibling);
} else {
- document.querySelector('#replies').appendChild(li);
+ document.getElementById('replies').appendChild(li);
}
updateRepliesCounter();
@@ -158,8 +158,8 @@ function newReply(e) {
}
function nextReply() {
- var li = document.querySelector('#replies>li.reply-new:first');
- if (li.length) {
+ var li = document.querySelector('#replies>li.reply-new');
+ if (li) {
li.classList.remove('reply-new');
li.removeEventListener('click', this);
li.childNodes[0].scrollIntoView();
@@ -169,13 +169,13 @@ function nextReply() {
function updateRepliesCounter() {
var replies = document.querySelectorAll('#replies>li.reply-new').length;
+ var wsthread = document.getElementById('wsthread');
if (replies) {
- var wsthread = document.querySelector('#wsthread');
wsthread.textContent = replies;
wsthread.style.display = 'block';
document.title = '[' + replies + '] ' + pageTitle;
} else {
- document.querySelector('#wsthread').style.display = 'none';
+ wsthread.style.display = 'none';
document.title = pageTitle;
}
}