aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
authorGravatar makc2016-09-14 13:24:46 +0200
committerGravatar makc2016-09-14 13:28:56 +0200
commit927f90b43e89ed7ec74a3d228ec70faf822304f9 (patch)
tree8573e4a095c9c098c7f17a18bd036cdc045bc9bf /juick-www/src
parent4db5b8262430c8333c5ac11c0bf9e3fe90f624a1 (diff)
add new replies to the bottom in list mode
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/static/scripts.js7
1 files changed, 6 insertions, 1 deletions
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);