From 294359d7f5526394d8dcfd0fd29f5ec4914cdde8 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 4 Aug 2024 13:40:22 +0000 Subject: improved content and comment collapse/expand rendering --- view/js/main.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'view/js/main.js') 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: '' + aStr.divgrowmore + '', - lessLink: '' + aStr.divgrowless + '', + moreLink: ' ' + aStr.divgrowmore + '', + lessLink: ' ' + aStr.divgrowless + '', beforeToggle: function(trigger, element, expanded) { if(expanded) { if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) { -- cgit v1.2.3