From 14eb4326e76bddaec8421fdaa87e0c3ac9bb76e0 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sun, 5 May 2019 18:13:00 +0200 Subject: Scroll back to initial low level comment --- view/js/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 8dfb04779..5592fd63d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1160,8 +1160,14 @@ function doreply(parent, ident, owner, hint) { } function doscroll(parent, hidden) { - $('.back-to-reply').remove(); - var pos = $(window).scrollTop(); + var back = $('.back-to-reply'); + if(back.length == 0) { + var pos = Math.round($(window).scrollTop()); + } + else { + var pos = back.attr('href').replace(/\D/g,'') + } + back.remove(); var x = '#hide-comments-outer-' + hidden.toString(); if($(x).length !== 0) { x = $(x).attr("onclick").replace(/\D/g,''); -- cgit v1.2.3