🎨 Support configuring the floating window hover trigger delay https://github.com/siyuan-note/siyuan/pull/17123

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-03-02 23:28:49 +08:00
parent c84c79fa05
commit e878e5cc4b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 6 additions and 6 deletions

View file

@ -268,7 +268,7 @@ export const editor = {
</div>
<span class="fn__space"></span>
<div class="fn__size200 fn__flex-center fn__flex">
<input class="b3-text-field fn__flex-1" id="floatWindowDelay" type="number" min="0" max="10000" value="${window.siyuan.config.editor.floatWindowDelay}"/>
<input class="b3-text-field fn__flex-1" id="floatWindowDelay" type="number" min="0" max="2000" value="${window.siyuan.config.editor.floatWindowDelay}"/>
<span class="fn__space"></span>
<span class="ft__on-surface fn__flex-center">ms</span>
</div>
@ -488,9 +488,9 @@ export const editor = {
if (floatWindowDelay < 0 || isNaN(floatWindowDelay)) {
floatWindowDelay = 0;
(editor.element.querySelector("#floatWindowDelay") as HTMLInputElement).value = "0";
} else if (floatWindowDelay > 10000) {
floatWindowDelay = 10000;
(editor.element.querySelector("#floatWindowDelay") as HTMLInputElement).value = "10000";
} else if (floatWindowDelay > 2000) {
floatWindowDelay = 2000;
(editor.element.querySelector("#floatWindowDelay") as HTMLInputElement).value = "2000";
}
fetchPost("/api/setting/setEditor", {

View file

@ -27,7 +27,7 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"editorMarkdownInlineSup", "editorMarkdownInlineSupTip", "editorMarkdownInlineSub", "editorMarkdownInlineSubTip",
"editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip",
"editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip", "editorMarkdownInlineMark", "editorMarkdownInlineMarkTip",
"allowHTMLBLockScript", "allowHTMLBLockScriptTip", "backlinkExpandTip", "backmentionExpandTip",
"allowHTMLBLockScript", "allowHTMLBLockScriptTip", "floatWindowDelay", "floatWindowDelayTip",
"backlinkContainChildren", "backlinkContainChildrenTip", "allowSVGScript", "allowSVGScriptTip"
]),

View file

@ -321,7 +321,7 @@ func setEditor(c *gin.Context) {
v := 620
editor.FloatWindowDelay = &v
} else {
*editor.FloatWindowDelay = max(0, min(10000, *editor.FloatWindowDelay))
*editor.FloatWindowDelay = max(0, min(2000, *editor.FloatWindowDelay))
}
oldVirtualBlockRef := model.Conf.Editor.VirtualBlockRef