mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
76b832b02c
commit
a15d69a615
4 changed files with 38 additions and 12 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "20200924100950-9op5xi1",
|
"id": "20200924100950-9op5xi1",
|
||||||
"title": "Shortcuts",
|
"title": "Shortcuts",
|
||||||
"type": "doc",
|
"type": "doc",
|
||||||
"updated": "20221107215308"
|
"updated": "20221107221232"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8293,7 +8293,7 @@
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"colgroup": "||",
|
"colgroup": "||",
|
||||||
"id": "20220619002135-s399g7e",
|
"id": "20220619002135-s399g7e",
|
||||||
"updated": "20221107215308"
|
"updated": "20221107221232"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8571,7 +8571,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
"Data": ""
|
"Data": " / Middle mouse button"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
"id": "20200813004551-gm0pbn1",
|
"id": "20200813004551-gm0pbn1",
|
||||||
"title": "快捷键",
|
"title": "快捷键",
|
||||||
"type": "doc",
|
"type": "doc",
|
||||||
"updated": "20221107215100"
|
"updated": "20221107220925"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8238,7 +8238,7 @@
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"colgroup": "||",
|
"colgroup": "||",
|
||||||
"id": "20220619001217-e9cwukj",
|
"id": "20220619001217-e9cwukj",
|
||||||
"updated": "20221107215100"
|
"updated": "20221107220925"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8508,7 +8508,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
"Data": ""
|
"Data": " / 鼠标中键"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -8529,10 +8529,10 @@
|
||||||
{
|
{
|
||||||
"ID": "20221107214439-v40c6qz",
|
"ID": "20221107214439-v40c6qz",
|
||||||
"Type": "NodeHeading",
|
"Type": "NodeHeading",
|
||||||
"HeadingLevel": 2,
|
"HeadingLevel": 3,
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"id": "20221107214439-v40c6qz",
|
"id": "20221107214439-v40c6qz",
|
||||||
"updated": "20221107214442"
|
"updated": "20221107220850"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"icon": "2328",
|
"icon": "2328",
|
||||||
"id": "20211226122549-jktxego",
|
"id": "20211226122549-jktxego",
|
||||||
"title": "快捷鍵",
|
"title": "快捷鍵",
|
||||||
"updated": "20221107215259"
|
"updated": "20221107221152"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8294,7 +8294,7 @@
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"colgroup": "||",
|
"colgroup": "||",
|
||||||
"id": "20220619002223-xwob5s8",
|
"id": "20220619002223-xwob5s8",
|
||||||
"updated": "20221107215259"
|
"updated": "20221107221152"
|
||||||
},
|
},
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
|
|
@ -8580,7 +8580,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
"Data": ""
|
"Data": " / 鼠標中鍵"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,26 @@ export class Files extends Model {
|
||||||
}
|
}
|
||||||
setPanelFocus(this.element.parentElement);
|
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) => {
|
this.element.addEventListener("click", (event) => {
|
||||||
if (event.detail !== 1) {
|
if (event.detail !== 1) {
|
||||||
setPanelFocus(this.element.parentElement);
|
setPanelFocus(this.element.parentElement);
|
||||||
|
|
@ -249,9 +269,15 @@ export class Files extends Model {
|
||||||
position: "bottom",
|
position: "bottom",
|
||||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
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 {
|
} else {
|
||||||
openFileById({
|
openFileById({
|
||||||
removeCurrentTab: !((event.altKey && (event.metaKey || event.ctrlKey) && !event.shiftKey)),
|
|
||||||
id: target.getAttribute("data-node-id"),
|
id: target.getAttribute("data-node-id"),
|
||||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue