mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Fix confirm message
This commit is contained in:
@@ -37,7 +37,17 @@ Turbo.setConfirmMethod((message) => {
|
|||||||
dialog.addEventListener(
|
dialog.addEventListener(
|
||||||
"close",
|
"close",
|
||||||
() => {
|
() => {
|
||||||
resolve(dialog.returnValue === "confirm");
|
const confirmed = dialog.returnValue === "confirm";
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
document.getElementById("turbo-confirm-title").innerHTML =
|
||||||
|
"Are you sure?";
|
||||||
|
document.getElementById("turbo-confirm-body").innerHTML =
|
||||||
|
"You will not be able to undo this decision";
|
||||||
|
document.getElementById("turbo-confirm-accept").innerHTML = "Confirm";
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(confirmed);
|
||||||
},
|
},
|
||||||
{ once: true },
|
{ once: true },
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user