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:
@@ -1,5 +1,5 @@
|
||||
import { saveSettings, callPopup, substituteParams, getTokenCount, getRequestHeaders } from "../script.js";
|
||||
import { download, debounce, delay } from "./utils.js";
|
||||
import { download, debounce, delay, initScrollHeight, resetScrollHeight } from "./utils.js";
|
||||
|
||||
export {
|
||||
world_info,
|
||||
@@ -234,7 +234,16 @@ function appendWorldEntry(entry) {
|
||||
const keysecondary = $(this)
|
||||
.closest(".world_entry")
|
||||
.find(".keysecondary");
|
||||
|
||||
const keyPrimary = $(this)
|
||||
.closest(".world_entry")
|
||||
.find(".key");
|
||||
|
||||
const keyPrimaryHeight = $(keyPrimary).css('height');
|
||||
|
||||
keysecondary.css('height', keyPrimaryHeight) + 'px';
|
||||
value ? keysecondary.show() : keysecondary.hide();
|
||||
|
||||
});
|
||||
selectiveInput.prop("checked", entry.selective).trigger("input");
|
||||
selectiveInput.siblings(".checkbox_fancy").click(function () {
|
||||
@@ -319,20 +328,6 @@ function appendWorldEntry(entry) {
|
||||
return template;
|
||||
}
|
||||
|
||||
async function resetScrollHeight(element) {
|
||||
element.style.height = '';
|
||||
element.style.height = (element.scrollHeight) + 3 + 'px';
|
||||
}
|
||||
|
||||
async function initScrollHeight(element) {
|
||||
await delay(1);
|
||||
const height = Number($(element).prop("scrollHeight") + 3);
|
||||
console.log(height);
|
||||
//console.log(element.style.height);
|
||||
$(element).css("height", "");
|
||||
$(element).css("height", `${height}px`);
|
||||
}
|
||||
|
||||
async function deleteWorldInfoEntry(uid) {
|
||||
if (!world_info_data || !("entries" in world_info_data)) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user