This commit is contained in:
parent
cb2560ffda
commit
5e3d472edb
3 changed files with 6 additions and 0 deletions
|
@ -876,6 +876,9 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|||
}
|
||||
if (event.key === "Delete" || (event.key === "Backspace" && isMac())) {
|
||||
window.siyuan.menus.menu.remove();
|
||||
if (document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_CONFIRM}"]`)) {
|
||||
return;
|
||||
}
|
||||
deleteFiles(liElements);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -126,6 +126,7 @@ export abstract class Constants {
|
|||
public static readonly LOCAL_EMOJIS = "local-emojis";
|
||||
|
||||
// dialog
|
||||
public static readonly DIALOG_CONFIRM = "dialog-confirm";
|
||||
public static readonly DIALOG_OPENCARD = "dialog-opencard";
|
||||
public static readonly DIALOG_MAKECARD = "dialog-makecard";
|
||||
public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {isMobile} from "../util/functions";
|
||||
import {Dialog} from "./index";
|
||||
import {Constants} from "../constants";
|
||||
|
||||
export const confirmDialog = (title: string, text: string,
|
||||
confirm?: (dialog?: Dialog) => void,
|
||||
|
@ -33,4 +34,5 @@ export const confirmDialog = (title: string, text: string,
|
|||
}
|
||||
dialog.destroy();
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_CONFIRM);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue