mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
c9a909d033
commit
545fc07314
3 changed files with 21 additions and 0 deletions
|
|
@ -7,6 +7,15 @@ import {onGet} from "../protyle/util/onGet";
|
|||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||
|
||||
export const openCard = () => {
|
||||
const exit = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) {
|
||||
item.destroy();
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (exit) {
|
||||
return;
|
||||
}
|
||||
let decksHTML = '<option value="">All</option>';
|
||||
fetchPost("/api/riff/getRiffDecks", {}, (response) => {
|
||||
response.data.forEach((deck: { id: string, name: string }) => {
|
||||
|
|
|
|||
|
|
@ -537,6 +537,7 @@ export const globalShortcut = () => {
|
|||
if (matchHotKey(window.siyuan.config.keymap.general.riffCard.custom, event)) {
|
||||
openCard();
|
||||
if (target.classList.contains("protyle-wysiwyg") ||
|
||||
target.tagName === "TABLE" ||
|
||||
target.classList.contains("protyle-title__input") ||
|
||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
||||
target.blur();
|
||||
|
|
@ -547,6 +548,7 @@ export const globalShortcut = () => {
|
|||
if (matchHotKey(window.siyuan.config.keymap.general.dailyNote.custom, event)) {
|
||||
newDailyNote();
|
||||
if (target.classList.contains("protyle-wysiwyg") ||
|
||||
target.tagName === "TABLE" ||
|
||||
target.classList.contains("protyle-title__input") ||
|
||||
target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
|
||||
target.blur();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@ import {getNotebookName, getOpenNotebookCount} from "./pathName";
|
|||
import {validateName} from "../editor/rename";
|
||||
|
||||
export const newDailyNote = () => {
|
||||
const exit = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.dailyNote.custom) {
|
||||
item.destroy();
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (exit) {
|
||||
return;
|
||||
}
|
||||
const openCount = getOpenNotebookCount();
|
||||
if (openCount === 0) {
|
||||
showMessage(window.siyuan.languages.newFileTip);
|
||||
|
|
@ -48,6 +57,7 @@ export const newDailyNote = () => {
|
|||
</div>`,
|
||||
width: isMobile() ? "80vw" : "520px",
|
||||
});
|
||||
dialog.element.setAttribute("data-key", window.siyuan.config.keymap.general.dailyNote.custom);
|
||||
const btnsElement = dialog.element.querySelectorAll(".b3-button");
|
||||
const selectElement = dialog.element.querySelector(".b3-select") as HTMLSelectElement;
|
||||
selectElement.value = localNotebookId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue