feat: Make splits resizable

This commit is contained in:
SiriusXT 2025-09-02 22:05:26 +08:00
parent 5436011f8e
commit 2264369e9e

View File

@ -150,16 +150,9 @@ function createSplitInstance(targetNtxIds: string[]) {
}
const rafId = requestAnimationFrame(() => {
if (!splitNoteContainer){
splitNoteContainer = $("#center-pane").find(".split-note-container-widget")[0];
}
const splitPanels: HTMLElement[] = [];
for (const el of splitNoteContainer.querySelectorAll(':scope > .note-split')) {
const dataId = el.getAttribute('data-ntx-id');
if (dataId && targetNtxIds.includes(dataId)) {
splitPanels.push(el as HTMLElement);
}
}
splitNoteContainer = splitNoteContainer ?? $("#center-pane").find(".split-note-container-widget")[0];
const splitPanels = [...splitNoteContainer.querySelectorAll<HTMLElement>(':scope > .note-split')]
.filter(el => targetNtxIds.includes(el.getAttribute('data-ntx-id') ?? ""));
const splitInstance = Split(splitPanels, {
gutterSize: DEFAULT_GUTTER_SIZE,
minSize: 150,