diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index 4efc7fa5f..d859bc035 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -54,6 +54,11 @@ export const openCardByData = (cardsData: ICard[], html = "") => { ${window.siyuan.languages.noDueCard}
+ +
@@ -143,8 +148,10 @@ export const openCardByData = (cardsData: ICard[], html = "") => { type = "2"; } else if (event.detail === "4" || event.detail === ";") { type = "3"; - } else if (event.detail === "s") { + } else if (event.detail === " ") { type = "-1"; + }else if (event.detail === "p") { + type = "-2"; } } if (!type) { @@ -168,6 +175,20 @@ export const openCardByData = (cardsData: ICard[], html = "") => { actionElements[1].classList.remove("fn__none"); return; } + if (type === "-2") { + if (index > 0) { + index--; + editor.protyle.element.classList.add("card__block--hide"); + nextCard({ + countElement, + editor, + actionElements, + index, + blocks + }) + } + return; + } if (["0", "1", "2", "3"].includes(type)) { fetchPost("/api/riff/reviewRiffCard", { deckID: blocks[index].deckID, @@ -239,6 +260,11 @@ const nextCard = (options: { options.editor.protyle.element.nextElementSibling.classList.add("fn__none"); options.countElement.lastElementChild.innerHTML = `${options.index + 1}/${options.blocks.length}`; options.countElement.classList.remove("fn__none"); + if (options.index === 0) { + options.actionElements[0].firstElementChild.setAttribute("disabled", "disabled"); + } else{ + options.actionElements[0].firstElementChild.removeAttribute("disabled"); + } fetchPost("/api/filetree/getDoc", { id: options.blocks[options.index].blockID, mode: 0, diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 881f49d1d..58edc6455 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -384,7 +384,7 @@ export const globalShortcut = () => { if (!event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && !["INPUT", "TEXTAREA"].includes((event.target as HTMLElement).tagName) && - ["1", "2", "3", "4", "j", "k", "l", ";", "s"].includes(event.key.toLowerCase())) { + ["1", "2", "3", "4", "j", "k", "l", ";", "s", " ", "p"].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;