From f300c967fe201b86889916a2f59c2d1cd4bfcc99 Mon Sep 17 00:00:00 2001 From: terrtia Date: Fri, 31 Jan 2025 15:50:45 +0100 Subject: [PATCH] fix: [show tracker] add btn to hide/show long rule --- var/www/templates/hunter/tracker_show.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/var/www/templates/hunter/tracker_show.html b/var/www/templates/hunter/tracker_show.html index 38586517..21e7aafa 100644 --- a/var/www/templates/hunter/tracker_show.html +++ b/var/www/templates/hunter/tracker_show.html @@ -447,12 +447,13 @@
Filter Objects:
const lineHeight = parseFloat(window.getComputedStyle(textElement).lineHeight); var maxLines = 30; const maxHeight = lineHeight * maxLines; - - // Apply initial truncation - textElement.style.maxHeight = maxHeight + 'px'; + if (textElement.getBoundingClientRect().height < maxHeight) { + textElement.style.maxHeight = '100%' btn_read_more.hide(); } else { + // Apply initial truncation + textElement.style.maxHeight = maxHeight + 'px'; btn_read_more.on("click", function() { if (btn_read_more.text() === "Show more") { textElement.style.maxHeight = 'none';