Skip to content

Commit 4af868c

Browse files
committed
🎨 Improve the drag-and-drop divider in the search window
fix #12094
1 parent 6564f0e commit 4af868c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

app/src/search/assets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const openSearchAsset = (element: HTMLElement, isStick: boolean) => {
135135
moveEvent.stopPropagation();
136136
const previousNowSize = (previousSize + (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
137137
const nextNowSize = (nextSize - (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
138-
if (previousNowSize < 120 || nextNowSize < 120) {
138+
if (nextNowSize < 120 || (previousNowSize < 120 && previousSize >= 120) || (previousNowSize < 120 && previousNowSize < previousSize)) {
139139
return;
140140
}
141141
previewElement.style[direction === "lr" ? "width" : "height"] = nextNowSize + "px";

app/src/search/unRef.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export const openSearchUnRef = (element: HTMLElement, editor: Protyle) => {
5252
moveEvent.stopPropagation();
5353
const previousNowSize = (previousSize + (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
5454
const nextNowSize = (nextSize - (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
55-
if (previousNowSize < 120 || nextNowSize < 120) {
55+
// 编辑器 scroll 最小高度 155px https://github.com/siyuan-note/siyuan/issues/8519
56+
if (nextNowSize < 155 || (previousNowSize < 120 && previousSize >= 120) || (previousNowSize < 120 && previousNowSize < previousSize)) {
5657
return;
5758
}
5859
nextElement.style[direction === "lr" ? "width" : "height"] = nextNowSize + "px";

app/src/search/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele
301301
moveEvent.stopPropagation();
302302
const previousNowSize = (previousSize + (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
303303
const nextNowSize = (nextSize - (moveEvent[direction === "lr" ? "clientX" : "clientY"] - x));
304-
if (previousNowSize < 120 || nextNowSize < 120) {
304+
// 编辑器 scroll 最小高度 155px https://github.com/siyuan-note/siyuan/issues/8519
305+
if (nextNowSize < 155 || (previousNowSize < 120 && previousSize >= 120) || (previousNowSize < 120 && previousNowSize < previousSize)) {
305306
return;
306307
}
307308
nextElement.style[direction === "lr" ? "width" : "height"] = nextNowSize + "px";

0 commit comments

Comments
 (0)