From 927f90b43e89ed7ec74a3d228ec70faf822304f9 Mon Sep 17 00:00:00 2001 From: makc Date: Wed, 14 Sep 2016 13:24:46 +0200 Subject: add new replies to the bottom in list mode --- juick-www/src/main/static/scripts.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index 0ab31345..94b6ba65 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -78,6 +78,11 @@ function wsShutdown() { } } +function isTreeMode() { + // relies on UserThread.printReplies implementation TODO keep this in cookie or something + return document.querySelector('.title2-right a').href.match(/\?view=(\w+)/)[1] == 'list'; +} + function wsIncomingReply(msg) { var li = document.createElement('li'); li.setAttribute('class', 'msg reply-new'); @@ -149,7 +154,7 @@ function wsIncomingReply(msg) { li.querySelector('.msg-txt').textContent = msg.body; - if (msg.replyto > 0) { + if (isTreeMode() && (msg.replyto > 0)) { var p = document.getElementById(msg.replyto); li.style.marginLeft = parseInt(p.style.marginLeft) + 20 + 'px'; p.parentNode.insertBefore(li, p.nextSibling); -- cgit v1.2.3