This commit is contained in:
Vanessa 2022-09-22 15:22:11 +08:00
parent cb1c75a5b7
commit 407b3b0040
2 changed files with 4 additions and 3 deletions

View file

@ -234,7 +234,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
hideElements(["select"], protyle);
return false;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event)) {
if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) && !event.repeat) {
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) {
setFold(protyle, selectElements[0]);
@ -255,7 +255,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.preventDefault();
return false;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
if (matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event) && !event.repeat) {
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) {
setFold(protyle, selectElements[0], true);

View file

@ -536,7 +536,7 @@ export const globalShortcut = () => {
}
// 面板折叠展开操作
if (matchHotKey(window.siyuan.config.keymap.editor.general.collapse.custom, event) || matchHotKey(window.siyuan.config.keymap.editor.general.expand.custom, event)) {
if (!event.repeat && (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 => {