MVC (layered variant)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
$(function () {
|
||||
$(document).on('click', '.delete', function (event) {
|
||||
if (!confirm("Delete entry?")) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function showAppToast(options) {
|
||||
var toastOptions = options || {};
|
||||
var variant = toastOptions.variant || "success";
|
||||
var title = toastOptions.title || "Notification";
|
||||
var message = toastOptions.message || "";
|
||||
var toast = document.getElementById("app-toast");
|
||||
var header = document.getElementById("app-toast-header");
|
||||
var titleElement = document.getElementById("app-toast-title");
|
||||
var body = document.getElementById("app-toast-body");
|
||||
|
||||
if (!toast || !header || !titleElement || !body) {
|
||||
return;
|
||||
}
|
||||
|
||||
toast.className = "toast border-0 shadow-sm";
|
||||
header.className = "toast-header text-bg-" + variant;
|
||||
titleElement.textContent = title;
|
||||
body.textContent = message;
|
||||
|
||||
var bootstrapToast = new bootstrap.Toast(toast);
|
||||
bootstrapToast.show();
|
||||
}
|
||||
Reference in New Issue
Block a user