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,10 +26,16 @@ function setupLeftPaneResizer(leftPaneVisible: boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (leftPaneVisible) {
|
if (leftPaneVisible) {
|
||||||
leftInstance = Split(["#left-pane", "#rest-pane"], {
|
// Delayed initialization ensures that all DOM elements are fully rendered and part of the layout,
|
||||||
sizes: [leftPaneWidth, 100 - leftPaneWidth],
|
// preventing Split.js from retrieving incorrect dimensions due to #left-pane not being rendered yet,
|
||||||
gutterSize: DEFAULT_GUTTER_SIZE,
|
// which would cause the minSize setting to have no effect.
|
||||||
onDragEnd: (sizes) => options.save("leftPaneWidth", Math.round(sizes[0]))
|
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