mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-17 19:04:39 +01:00
UI: Minor fix/optimization
This commit is contained in:
parent
e8d1c66303
commit
16636c04b8
12
js/main.js
12
js/main.js
|
|
@ -1075,15 +1075,13 @@ document.fonts.addEventListener("loadingdone", (event) => {
|
|||
const currentHeight = chatInputRow.offsetHeight;
|
||||
const heightDifference = currentHeight - originalHeight;
|
||||
chatParent.style.marginBottom = `${originalMarginBottom + heightDifference}px`;
|
||||
if (!window.isScrolled) {
|
||||
chatParent.scrollTop = chatParent.scrollHeight - chatParent.clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for changes that might affect height
|
||||
const observer = new MutationObserver(updateMargin);
|
||||
observer.observe(chatInputRow, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
attributes: true
|
||||
});
|
||||
// Watch for size changes that affect height
|
||||
new ResizeObserver(updateMargin).observe(chatInputRow);
|
||||
|
||||
// Also listen for window resize
|
||||
window.addEventListener("resize", updateMargin);
|
||||
|
|
|
|||
Loading…
Reference in a new issue