♻️ Updated markdown preview extension
This commit is contained in:
@@ -140,11 +140,11 @@ const onMouseMove = (e: MouseEvent) => {
|
|||||||
|
|
||||||
// 获取编辑器容器高度作为最大限制
|
// 获取编辑器容器高度作为最大限制
|
||||||
const editorView = state.value.view;
|
const editorView = state.value.view;
|
||||||
const maxHeight = editorView
|
const maxHeight = editorView
|
||||||
? (editorView.dom.parentElement?.clientHeight || editorView.dom.clientHeight)
|
? (editorView.dom.parentElement?.clientHeight || editorView.dom.clientHeight)
|
||||||
: 9999;
|
: 9999;
|
||||||
|
|
||||||
const newHeight = Math.max(100, Math.min(maxHeight, startHeight + delta));
|
const newHeight = Math.max(10, Math.min(maxHeight, startHeight + delta));
|
||||||
markdownPreviewManager.updateHeight(newHeight);
|
markdownPreviewManager.updateHeight(newHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ onUnmounted(() => {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100px;
|
min-height: 10px;
|
||||||
background: var(--bg-primary);
|
background: var(--bg-primary);
|
||||||
border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
|
border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class MarkdownPreviewManager {
|
|||||||
|
|
||||||
this.state.value = {
|
this.state.value = {
|
||||||
visible: true,
|
visible: true,
|
||||||
position: { height: Math.max(100, defaultHeight) },
|
position: { height: Math.max(10, defaultHeight) },
|
||||||
content,
|
content,
|
||||||
blockFrom,
|
blockFrom,
|
||||||
blockTo,
|
blockTo,
|
||||||
@@ -85,7 +85,7 @@ class MarkdownPreviewManager {
|
|||||||
|
|
||||||
this.state.value = {
|
this.state.value = {
|
||||||
...this.state.value,
|
...this.state.value,
|
||||||
position: { height: Math.max(100, height) }
|
position: { height: Math.max(10, height) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user