mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-02 15:31:33 +00:00
Moved alerts and dialogs from unsupported bootbox to Sweetalert2 library
This commit is contained in:
parent
a489380f49
commit
99e56c4b1d
12 changed files with 842 additions and 805 deletions
|
|
@ -20,7 +20,7 @@
|
|||
import DatatablesController from "./datatables_controller.js";
|
||||
import TomSelect from "tom-select";
|
||||
|
||||
import * as bootbox from "bootbox";
|
||||
import {ConfirmSwal} from "../../../helpers/swal";
|
||||
|
||||
/**
|
||||
* This is the datatables controller for parts lists
|
||||
|
|
@ -146,15 +146,17 @@ export default class extends DatatablesController {
|
|||
bubbles: true, //This line is important, otherwise Turbo will not receive the event
|
||||
});
|
||||
|
||||
const confirm = bootbox.confirm({
|
||||
message: message, title: title, callback: function (result) {
|
||||
//If the dialog was confirmed, then submit the form.
|
||||
if (result) {
|
||||
that._confirmed = true;
|
||||
form.dispatchEvent(that._our_event);
|
||||
} else {
|
||||
that._confirmed = false;
|
||||
}
|
||||
ConfirmSwal.fire({
|
||||
titleText: title,
|
||||
text: message,
|
||||
icon: "warning"
|
||||
}).then(({isConfirmed}) => {
|
||||
//If the dialog was confirmed, then submit the form.
|
||||
if (isConfirmed) {
|
||||
that._confirmed = true;
|
||||
form.dispatchEvent(that._our_event);
|
||||
} else {
|
||||
that._confirmed = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue