From 136be4dfda616a9c0ee68eb3c31c138b65ef567f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 28 Jul 2016 02:01:21 +0300 Subject: www: fix replies unfolding --- juick-www/src/main/static/scripts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-www/src/main/static/scripts.js') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index d7c3ffe9..b9becc16 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -215,7 +215,9 @@ function onsubmitNewMessage() { } function showMoreReplies(el, id) { - el.closest('li').querySelector('.msg-comments').style.display = 'none'; + var foldedReplies = el.closest('li').querySelector('.msg-comments'); + if (!foldedReplies) { return } + foldedReplies.style.display = 'none'; var replies = document.querySelectorAll('#replies>li'), flagshow = 0, @@ -370,7 +372,7 @@ function unfoldReply() { while (el.style.display === 'none') { el = el.previousElementSibling; } - showMoreReplies(el); + showMoreReplies(el, anchor); window.location.replace(window.location.hash); } } -- cgit v1.2.3