mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
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())) {
|
if (event.key === "Delete" || (event.key === "Backspace" && isMac())) {
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
|
if (document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_CONFIRM}"]`)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
deleteFiles(liElements);
|
deleteFiles(liElements);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ export abstract class Constants {
|
||||||
public static readonly LOCAL_EMOJIS = "local-emojis";
|
public static readonly LOCAL_EMOJIS = "local-emojis";
|
||||||
|
|
||||||
// dialog
|
// dialog
|
||||||
|
public static readonly DIALOG_CONFIRM = "dialog-confirm";
|
||||||
public static readonly DIALOG_OPENCARD = "dialog-opencard";
|
public static readonly DIALOG_OPENCARD = "dialog-opencard";
|
||||||
public static readonly DIALOG_MAKECARD = "dialog-makecard";
|
public static readonly DIALOG_MAKECARD = "dialog-makecard";
|
||||||
public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";
|
public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import {isMobile} from "../util/functions";
|
import {isMobile} from "../util/functions";
|
||||||
import {Dialog} from "./index";
|
import {Dialog} from "./index";
|
||||||
|
import {Constants} from "../constants";
|
||||||
|
|
||||||
export const confirmDialog = (title: string, text: string,
|
export const confirmDialog = (title: string, text: string,
|
||||||
confirm?: (dialog?: Dialog) => void,
|
confirm?: (dialog?: Dialog) => void,
|
||||||
|
|
@ -33,4 +34,5 @@ export const confirmDialog = (title: string, text: string,
|
||||||
}
|
}
|
||||||
dialog.destroy();
|
dialog.destroy();
|
||||||
});
|
});
|
||||||
|
dialog.element.setAttribute("data-key", Constants.DIALOG_CONFIRM);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue