aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-05-05 14:14:07 +0200
committerMario <mario@mariovavti.com>2019-05-05 14:14:07 +0200
commit6cd968b53bc12ccc2125f062e42851bf1e501efe (patch)
tree0a39e2ebcc093c9e0ede4c364384cb1d5e25949f /view/js/main.js
parent2aa76d257ccd29144234408563c46d5af10a83c0 (diff)
downloadvolse-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.js24
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">&nbsp;&nbsp;&nbsp;</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;