mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-14 16:11:00 +08:00
This commit is contained in:
parent
84b29657f8
commit
5c034d93d0
@ -1158,15 +1158,6 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
||||
}
|
||||
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.recentDocs.custom, event)) {
|
||||
const openRecentDocsDialog = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.recentDocs.custom) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (openRecentDocsDialog) {
|
||||
hideElements(["dialog"]);
|
||||
return;
|
||||
}
|
||||
openRecentDocs();
|
||||
event.preventDefault();
|
||||
return;
|
||||
|
@ -8,8 +8,18 @@ import {getAllDocks} from "../layout/getAll";
|
||||
import {Dialog} from "../dialog";
|
||||
import {focusByRange} from "../protyle/util/selection";
|
||||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||
import {hideElements} from "../protyle/ui/hideElements";
|
||||
|
||||
export const openRecentDocs = () => {
|
||||
const openRecentDocsDialog = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.recentDocs.custom) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (openRecentDocsDialog) {
|
||||
hideElements(["dialog"]);
|
||||
return;
|
||||
}
|
||||
fetchPost("/api/storage/getRecentDocs", {}, (response) => {
|
||||
let range: Range;
|
||||
if (getSelection().rangeCount > 0) {
|
||||
|
@ -188,15 +188,6 @@ export const newCenterEmptyTab = (app: App) => {
|
||||
event.preventDefault();
|
||||
break;
|
||||
} else if (target.id === "editorEmptyRecent") {
|
||||
const openRecentDocsDialog = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.recentDocs.custom) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (openRecentDocsDialog) {
|
||||
hideElements(["dialog"]);
|
||||
return;
|
||||
}
|
||||
openRecentDocs();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
@ -25,6 +25,7 @@ import {confirmDialog} from "../dialog/confirmDialog";
|
||||
import {App} from "../index";
|
||||
import {isBrowser} from "../util/functions";
|
||||
import {unbindSaveUI} from "../boot/onGetConfig";
|
||||
import {openRecentDocs} from "../business/openRecentDocs";
|
||||
|
||||
const togglePinDock = (dock: Dock, icon: string) => {
|
||||
return {
|
||||
@ -371,6 +372,14 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
||||
}
|
||||
}],
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.recentDocs,
|
||||
icon: "iconFile",
|
||||
accelerator: window.siyuan.config.keymap.general.recentDocs.custom,
|
||||
click: () => {
|
||||
openRecentDocs();
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.lockScreen,
|
||||
icon: "iconLock",
|
||||
|
Loading…
Reference in New Issue
Block a user