From f39d2f07a411094f538255b35cd97f4be29a7288 Mon Sep 17 00:00:00 2001 From: makc Date: Wed, 14 Sep 2016 14:41:43 +0200 Subject: fix the fix when it has unfolding link --- juick-www/src/main/static/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-www/src') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index a5f7c4c0..91ea8bda 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -80,7 +80,7 @@ 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'; + return document.querySelector('.title2-right > a').href.match(/\?view=(\w+)/)[1] == 'list'; } function wsIncomingReply(msg) { -- cgit v1.2.3 From 975b300c01485317cbc1eaef160201ecd5a629de Mon Sep 17 00:00:00 2001 From: makc Date: Wed, 14 Sep 2016 14:59:19 +0200 Subject: skip nested replies too --- juick-www/src/main/static/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-www/src') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index 91ea8bda..ebeba198 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -157,7 +157,7 @@ function wsIncomingReply(msg) { if (isTreeMode() && (msg.replyto > 0)) { var p = document.getElementById(msg.replyto); var m = parseInt(p.style.marginLeft) + 20; - while (p.nextElementSibling && (parseInt(p.nextElementSibling.style.marginLeft) == m)) p = p.nextElementSibling; + while (p.nextElementSibling && (parseInt(p.nextElementSibling.style.marginLeft) >= m)) p = p.nextElementSibling; li.style.marginLeft = m + 'px'; p.parentNode.insertBefore(li, p.nextSibling); } else { -- cgit v1.2.3