mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-02-12 12:26:23 +00:00
fix: [show tracker] add btn to hide/show long rule
This commit is contained in:
parent
63be1f3d0f
commit
f300c967fe
1 changed files with 4 additions and 3 deletions
|
@ -447,12 +447,13 @@
|
|||
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';
|
||||
|
|
Loading…
Add table
Reference in a new issue