diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy index 358f57769..db6341493 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy @@ -7,7 +7,7 @@ "id": "20200924100950-9op5xi1", "title": "Shortcuts", "type": "doc", - "updated": "20221107215308" + "updated": "20221107221232" }, "Children": [ { @@ -8293,7 +8293,7 @@ "Properties": { "colgroup": "||", "id": "20220619002135-s399g7e", - "updated": "20221107215308" + "updated": "20221107221232" }, "Children": [ { @@ -8571,7 +8571,7 @@ }, { "Type": "NodeText", - "Data": "​" + "Data": "​ / Middle mouse button" } ] }, diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy index 62e44aeef..957d48974 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy @@ -7,7 +7,7 @@ "id": "20200813004551-gm0pbn1", "title": "快捷键", "type": "doc", - "updated": "20221107215100" + "updated": "20221107220925" }, "Children": [ { @@ -8238,7 +8238,7 @@ "Properties": { "colgroup": "||", "id": "20220619001217-e9cwukj", - "updated": "20221107215100" + "updated": "20221107220925" }, "Children": [ { @@ -8508,7 +8508,7 @@ }, { "Type": "NodeText", - "Data": "​" + "Data": "​ / 鼠标中键" } ] }, @@ -8529,10 +8529,10 @@ { "ID": "20221107214439-v40c6qz", "Type": "NodeHeading", - "HeadingLevel": 2, + "HeadingLevel": 3, "Properties": { "id": "20221107214439-v40c6qz", - "updated": "20221107214442" + "updated": "20221107220850" }, "Children": [ { diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy index e75fd146e..4c8d4eb28 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy @@ -6,7 +6,7 @@ "icon": "2328", "id": "20211226122549-jktxego", "title": "快捷鍵", - "updated": "20221107215259" + "updated": "20221107221152" }, "Children": [ { @@ -8294,7 +8294,7 @@ "Properties": { "colgroup": "||", "id": "20220619002223-xwob5s8", - "updated": "20221107215259" + "updated": "20221107221152" }, "Children": [ { @@ -8580,7 +8580,7 @@ }, { "Type": "NodeText", - "Data": "​" + "Data": "​ / 鼠標中鍵" } ] }, diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index b714d9301..4dd747619 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -183,6 +183,26 @@ export class Files extends Model { } setPanelFocus(this.element.parentElement); }); + this.element.addEventListener("mousedown", (event) => { + // 点击鼠标滚轮关闭 + if (event.button !== 1 || !window.siyuan.config.fileTree.openFilesUseCurrentTab) { + return; + } + let target = event.target as HTMLElement; + while (target && !target.isEqualNode(this.element)) { + if (target.tagName === "LI") { + openFileById({ + removeCurrentTab: false, + id: target.getAttribute("data-node-id"), + action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] + }); + event.stopPropagation(); + event.preventDefault(); + break; + } + target = target.parentElement; + } + }) this.element.addEventListener("click", (event) => { if (event.detail !== 1) { setPanelFocus(this.element.parentElement); @@ -249,9 +269,15 @@ export class Files extends Model { position: "bottom", action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] }); + } else if (window.siyuan.config.fileTree.openFilesUseCurrentTab && + event.altKey && (event.metaKey || event.ctrlKey) && !event.shiftKey) { + openFileById({ + removeCurrentTab: false, + id: target.getAttribute("data-node-id"), + action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] + }); } else { openFileById({ - removeCurrentTab: !((event.altKey && (event.metaKey || event.ctrlKey) && !event.shiftKey)), id: target.getAttribute("data-node-id"), action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] });