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 f300c96 commit bbfad6a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions var/www/templates/hunter/tracker_show.html
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,17 @@ <h5>Filter Objects:</h5>

// Hover effect
var btn_read_more = $('#btn_read_more')
var textElement = document.querySelectorAll(".text-collapse")[0];
var textElement = document.querySelector(".text-collapse");
const lineHeight = parseFloat(window.getComputedStyle(textElement).lineHeight);
var maxLines = 30;
const maxHeight = lineHeight * maxLines;

if (textElement.getBoundingClientRect().height < maxHeight) {

/*console.log(textElement.offsetHeight)
console.log(maxHeight)
if (textElement.offsetHeight > maxHeight) {
textElement.style.maxHeight = '100%'
btn_read_more.hide();
} else {
} else {*/
// Apply initial truncation
textElement.style.maxHeight = maxHeight + 'px';
btn_read_more.on("click", function() {
Expand All @@ -463,7 +465,7 @@ <h5>Filter Objects:</h5>
btn_read_more.text("Show more");
}
});
}
//}

function edit_tags() {
$('#div_edit_mails').hide();
Expand Down

0 comments on commit bbfad6a

Please sign in to comment.