aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-08-04 13:40:22 +0000
committerMario <mario@mariovavti.com>2024-08-04 13:40:22 +0000
commit294359d7f5526394d8dcfd0fd29f5ec4914cdde8 (patch)
tree7e07dac2ac2db141c6ff9ad18a9a0e549118e332 /view/js/main.js
parent8ff870482fcb7df20182bf7613ecd47901aeb468 (diff)
downloadvolse-hubzilla-294359d7f5526394d8dcfd0fd29f5ec4914cdde8.tar.gz
volse-hubzilla-294359d7f5526394d8dcfd0fd29f5ec4914cdde8.tar.bz2
volse-hubzilla-294359d7f5526394d8dcfd0fd29f5ec4914cdde8.zip
improved content and comment collapse/expand rendering
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/view/js/main.js b/view/js/main.js
index ab87b4bda..dfec9e0f0 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -514,16 +514,19 @@ function viewsrc(id) {
}
function showHideComments(id) {
- if( $('#collapsed-comments-' + id).is(':visible')) {
+ if($('#collapsed-comments-' + id).is(':visible')) {
$('#collapsed-comments-' + id + ' .autotime').timeago('dispose');
$('#collapsed-comments-' + id).hide();
- $('#hide-comments-' + id).html(aStr.showmore);
+ $('#hide-comments-label-' + id).html(aStr.showmore);
$('#hide-comments-total-' + id).show();
+ $('#hide-comments-icon-' + id).toggleClass('bi-chevron-down bi-chevron-up');
+
} else {
$('#collapsed-comments-' + id + ' .autotime').timeago();
$('#collapsed-comments-' + id).show();
- $('#hide-comments-' + id).html(aStr.showfewer);
+ $('#hide-comments-label-' + id).html(aStr.showfewer);
$('#hide-comments-total-' + id).hide();
+ $('#hide-comments-icon-' + id).toggleClass('bi-chevron-down bi-chevron-up');
}
}
@@ -834,7 +837,7 @@ function scrollToItem() {
var scrolltoid = $('.collapsed-comments').attr('id').substring(19);
$('#collapsed-comments-' + scrolltoid + ' .autotime').timeago();
$('#collapsed-comments-' + scrolltoid).show();
- $('#hide-comments-' + scrolltoid).html(aStr.showfewer);
+ $('#hide-comments-label-' + scrolltoid).html(aStr.showfewer);
$('#hide-comments-total-' + scrolltoid).hide();
}
$('html, body').animate({ scrollTop: $(this).offset().top - $('nav').outerHeight(true) }, 'slow');
@@ -868,8 +871,8 @@ function collapseHeight() {
startOpen: open,
heightMargin: 50,
collapsedHeight: divmore_height,
- moreLink: '<a href="#" class="divgrow-showmore fakelink small">' + aStr.divgrowmore + '</a>',
- lessLink: '<a href="#" class="divgrow-showmore fakelink small">' + aStr.divgrowless + '</a>',
+ moreLink: '<a href="#" class="divgrow-showmore fakelink"><i class="bi bi-chevron-down align-middle divgrow-showmore-icon"></i>&nbsp;<span class="divgrow-showmore-label align-middle">' + aStr.divgrowmore + '</span></a>',
+ lessLink: '<a href="#" class="divgrow-showmore fakelink"><i class="bi bi-chevron-up align-middle divgrow-showmore-icon"></i>&nbsp;<span class="divgrow-showmore-label align-middle">' + aStr.divgrowless + '</span></a>',
beforeToggle: function(trigger, element, expanded) {
if(expanded) {
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {