mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 23:41:49 +00:00
show less btn fix
This commit is contained in:
parent
c25815f752
commit
561165b17c
2 changed files with 10 additions and 5 deletions
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
|
||||
.step-action-buttons .expand-btn {
|
||||
display: inline-flex;
|
||||
display: none;
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
border: none;
|
||||
|
|
|
|||
|
|
@ -2067,10 +2067,15 @@ function setupCollapsible(messageDiv, containerSelector, initialExpanded, action
|
|||
if (!messageDiv.classList.contains("has-overflow")) {
|
||||
requestAnimationFrame(() => {
|
||||
const body = messageDiv.querySelector(".message-body");
|
||||
const wasExp = messageDiv.classList.contains("expanded");
|
||||
messageDiv.classList.remove("expanded");
|
||||
messageDiv.classList.toggle("has-overflow", body?.scrollHeight > body?.clientHeight);
|
||||
messageDiv.classList.toggle("expanded", wasExp);
|
||||
if (!body) return;
|
||||
|
||||
// calculate max height without touching DOM (no scroll jitter)
|
||||
const fontSize = parseFloat(getComputedStyle(body).fontSize || "16");
|
||||
const maxHeight = messageDiv.classList.contains("expanded")
|
||||
? fontSize * 15
|
||||
: body.clientHeight;
|
||||
|
||||
messageDiv.classList.toggle("has-overflow", body.scrollHeight > maxHeight);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue