mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-11 23:22:33 +01:00
This commit is contained in:
parent
1d142c9df1
commit
f2a53014fb
16 changed files with 32 additions and 18 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import {isMobile} from "../util/functions";
|
||||
import {Dialog} from "./index";
|
||||
|
||||
export const confirmDialog = (title: string, text: string, confirm?: (dialog?: Dialog) => void, cancel?: (dialog: Dialog) => void) => {
|
||||
export const confirmDialog = (title: string, text: string,
|
||||
confirm?: (dialog?: Dialog) => void,
|
||||
cancel?: (dialog: Dialog) => void,
|
||||
isDelete = false) => {
|
||||
if (!text && !title) {
|
||||
confirm();
|
||||
return;
|
||||
|
|
@ -13,7 +16,7 @@ export const confirmDialog = (title: string, text: string, confirm?: (dialog?: D
|
|||
</div>
|
||||
<div class="b3-dialog__action">
|
||||
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
|
||||
<button class="b3-button b3-button--text" id="confirmDialogConfirmBtn">${window.siyuan.languages.confirm}</button>
|
||||
<button class="b3-button ${isDelete ? "b3-button--remove" : "b3-button--text"}" id="confirmDialogConfirmBtn">${window.siyuan.languages[isDelete ? "delete" : "confirm"]}</button>
|
||||
</div>`,
|
||||
width: isMobile() ? "92vw" : "520px",
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue