mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 21:52:33 +01:00
This commit is contained in:
parent
37ba3db35f
commit
5f9e55539e
15 changed files with 26 additions and 29 deletions
|
|
@ -536,7 +536,7 @@ export const globalShortcut = () => {
|
|||
}
|
||||
|
||||
// 面板折叠展开操作
|
||||
if (matchHotKey("⌘↑", event) || matchHotKey("⌘↓", event)) {
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) || matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
|
||||
let activePanelElement = document.querySelector(".block__icons--active");
|
||||
if (!activePanelElement) {
|
||||
Array.from(document.querySelectorAll(".layout__wnd--active .layout-tab-container > div")).forEach(item => {
|
||||
|
|
@ -547,11 +547,11 @@ export const globalShortcut = () => {
|
|||
});
|
||||
}
|
||||
if (activePanelElement) {
|
||||
if (matchHotKey("⌘↑", event)) {
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event)) {
|
||||
if (activePanelElement.querySelector('.block__icon[data-type="collapse"]')) {
|
||||
activePanelElement.querySelector('.block__icon[data-type="collapse"]').dispatchEvent(new CustomEvent("click"));
|
||||
}
|
||||
} else if (matchHotKey("⌘↓", event)) {
|
||||
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
|
||||
if (activePanelElement.querySelector('.block__icon[data-type="expand"]')) {
|
||||
activePanelElement.querySelector('.block__icon[data-type="expand"]').dispatchEvent(new CustomEvent("click"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue