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.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);