mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-19 02:10:04 +08:00
To avoid the left pane from sometimes being resized to a very small width.
This commit is contained in:
parent
a76ca76813
commit
bd4ebd3893
@ -26,11 +26,17 @@ function setupLeftPaneResizer(leftPaneVisible: boolean) {
|
||||
}
|
||||
|
||||
if (leftPaneVisible) {
|
||||
// Delayed initialization ensures that all DOM elements are fully rendered and part of the layout,
|
||||
// preventing Split.js from retrieving incorrect dimensions due to #left-pane not being rendered yet,
|
||||
// which would cause the minSize setting to have no effect.
|
||||
requestAnimationFrame(() => {
|
||||
leftInstance = Split(["#left-pane", "#rest-pane"], {
|
||||
sizes: [leftPaneWidth, 100 - leftPaneWidth],
|
||||
gutterSize: DEFAULT_GUTTER_SIZE,
|
||||
minSize: [150, 300],
|
||||
onDragEnd: (sizes) => options.save("leftPaneWidth", Math.round(sizes[0]))
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user