diff --git a/app/src/assets/scss/_dialog.scss b/app/src/assets/scss/_dialog.scss index 73ebc36ed..0c30dbb16 100644 --- a/app/src/assets/scss/_dialog.scss +++ b/app/src/assets/scss/_dialog.scss @@ -111,7 +111,7 @@ overflow: auto; } - &__card { + &__cardempty { display: flex; justify-content: center; flex-direction: column; @@ -119,4 +119,15 @@ text-align: center; color: var(--b3-theme-on-surface); } + + &__cardblock { + .protyle-wysiwyg { + padding: 16px; + } + + span[data-type~=mark] { + transition: var(--b3-transition); + color: var(--b3-protyle-inline-mark-background) !important; + } + } } diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index e7692c15d..34077e571 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -21,21 +21,23 @@ export const openCard = () => { } const dialog = new Dialog({ title: window.siyuan.languages.riffCard, - content: `
+ content: `
${countHTML}
-
-
${window.siyuan.languages.noDueCard}
+
+
${window.siyuan.languages.noDueCard}
- + - + - + + +
@@ -99,6 +101,8 @@ export const openCard = () => { type = "2" } else if (event.detail === "e") { type = "3" + }else if (event.detail === "s") { + type = "-1" } } if (!type) { @@ -107,7 +111,13 @@ export const openCard = () => { type = buttonElement.getAttribute("data-type"); } } - if (!type) { + if (!type || !blocks[index]) { + return; + } + event.preventDefault(); + event.stopPropagation(); + if (type === "-1") { + editor.protyle.element.classList.toggle("b3-dialog__cardblock"); return; } if (["0", "1", "2", "3"].includes(type)) { @@ -129,8 +139,6 @@ export const openCard = () => { onGet(response, editor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]); }); }) - event.preventDefault(); - event.stopPropagation(); } }) }) diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index b2935ec20..6db0f27d6 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -343,7 +343,7 @@ export const globalShortcut = () => { return; } - if (!event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && ["a", "h", "g", "e"].includes(event.key.toLowerCase())) { + if (!event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && ["s","a", "h", "g", "e"].includes(event.key.toLowerCase())) { const openCardDialog = window.siyuan.dialogs.find(item => { if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) { return true;