mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
19940e266b
commit
24709d29ad
7 changed files with 42 additions and 48 deletions
|
|
@ -19,7 +19,7 @@ import {setPosition} from "../util/setPosition";
|
|||
import {updateTransaction} from "../protyle/wysiwyg/transaction";
|
||||
import {Bookmark} from "../layout/dock/Bookmark";
|
||||
import {rename} from "../editor/rename";
|
||||
import {openAsset, openBy} from "../editor/util";
|
||||
import {deleteFile, openAsset, openBy} from "../editor/util";
|
||||
import {matchHotKey} from "../protyle/util/hotKey";
|
||||
import * as dayjs from "dayjs";
|
||||
import {Constants} from "../constants";
|
||||
|
|
@ -774,20 +774,7 @@ export const deleteMenu = (notebookId: string, name: string, pathString: string)
|
|||
label: window.siyuan.languages.delete,
|
||||
accelerator: "⌦",
|
||||
click: () => {
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: getDisplayName(pathString, true, true)
|
||||
}, (response) => {
|
||||
let tip = `${window.siyuan.languages.confirmDelete} <b>${name}</b>?`;
|
||||
if (response.data.subFileCount > 0) {
|
||||
tip = `${window.siyuan.languages.confirmDelete} <b>${name}</b> ${window.siyuan.languages.andSubFile.replace("x", response.data.subFileCount)}?`;
|
||||
}
|
||||
confirmDialog(window.siyuan.languages.delete, tip, () => {
|
||||
fetchPost("/api/filetree/removeDoc", {
|
||||
notebook: notebookId,
|
||||
path: pathString
|
||||
});
|
||||
});
|
||||
});
|
||||
deleteFile(notebookId, pathString, name);
|
||||
}
|
||||
}).element;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue