diff options
author | Max Kostikov <max@kostikov.co> | 2019-05-05 14:14:07 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-05-05 14:14:07 +0200 |
commit | 6cd968b53bc12ccc2125f062e42851bf1e501efe (patch) | |
tree | 0a39e2ebcc093c9e0ede4c364384cb1d5e25949f /view/js/main.js | |
parent | 2aa76d257ccd29144234408563c46d5af10a83c0 (diff) | |
download | volse-hubzilla-6cd968b53bc12ccc2125f062e42851bf1e501efe.tar.gz volse-hubzilla-6cd968b53bc12ccc2125f062e42851bf1e501efe.tar.bz2 volse-hubzilla-6cd968b53bc12ccc2125f062e42851bf1e501efe.zip |
Add arrows to scroll between related comments
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index b99fc0586..5f9f9044f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1159,7 +1159,28 @@ function doreply(parent, ident, owner, hint) { $('#comment-edit-text-' + parent.toString()).focus(); } -function dropItem(url, object) { +function doscroll(parent, hidden) { + var pos = $(window).scrollTop(); + var x = '#hide-comments-outer-' + hidden.toString(); + if($(x).length !== 0) { + x = $(x).attr("onclick").replace(/\D/g,''); + var c = '#collapsed-comments-' + x; + if($(c).length !== 0 && (! $(c).is(':visible'))) { + showHideComments(x); + pos += $('#collapsed-comments-' + x).height(); + } + } + 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"> </i></a>').insertBefore('#wall-item-info-' + id.attr('id').replace(/\D/g,'')); +} + +function doscrollback(pos) { + $('.back-to-reply').remove(); + $(window).scrollTop(pos); +} + +function dropItem(url, object) { var confirm = confirmDelete(); if(confirm) { @@ -1171,7 +1192,6 @@ function dropItem(url, object) { }); }); return true; - } else { return false; |