Skip to content

Commit

Permalink
fix: [show tracker] add btn to hide/show long rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 31, 2025
1 parent 63be1f3 commit f300c96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions var/www/templates/hunter/tracker_show.html
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,13 @@ <h5>Filter Objects:</h5>
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';
Expand Down

0 comments on commit f300c96

Please sign in to comment.