mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
-fix WI entry 2ndary key height
-initHeight and resetHeight functions moved from WI to utils
This commit is contained in:
@ -161,4 +161,18 @@ export function restoreCaretPosition(element, position) {
|
||||
const selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
|
||||
export async function resetScrollHeight(element) {
|
||||
element.style.height = '';
|
||||
element.style.height = (element.scrollHeight) + 3 + 'px';
|
||||
}
|
||||
|
||||
export async function initScrollHeight(element) {
|
||||
await delay(1);
|
||||
const height = Number($(element).prop("scrollHeight") + 3);
|
||||
console.log(`init height to ${height}`);
|
||||
//console.log(element.style.height);
|
||||
$(element).css("height", "");
|
||||
$(element).css("height", `${height}px`);
|
||||
}
|
Reference in New Issue
Block a user