aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 5f9f9044f..8dfb04779 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1160,6 +1160,7 @@ function doreply(parent, ident, owner, hint) {
}
function doscroll(parent, hidden) {
+ $('.back-to-reply').remove();
var pos = $(window).scrollTop();
var x = '#hide-comments-outer-' + hidden.toString();
if($(x).length !== 0) {
@@ -1167,10 +1168,10 @@ function doscroll(parent, hidden) {
var c = '#collapsed-comments-' + x;
if($(c).length !== 0 && (! $(c).is(':visible'))) {
showHideComments(x);
- pos += $('#collapsed-comments-' + x).height();
+ pos += $(c).height();
}
}
- id = $('[data-mid="' + parent + '"]');
+ var id = $('[data-mid="' + parent + '"]');
$('html, body').animate({scrollTop:(id.offset().top) - 50}, 'slow');
$('<a href="javascript:doscrollback(' + pos + ');" class="back-to-reply" title="' + aStr['to_reply'] + '"><i class="fa fa-angle-double-down float-right">&nbsp;&nbsp;&nbsp;</i></a>').insertBefore('#wall-item-info-' + id.attr('id').replace(/\D/g,''));
}