Files
pulse-signage/src/web/public/js/lib/modal.js
T
2026-07-25 15:11:41 +01:00

32 lines
641 B
JavaScript

(function () {
function getOrCreate(modalElement) {
if (!modalElement || !window.bootstrap || !window.bootstrap.Modal) {
return null;
}
return window.bootstrap.Modal.getOrCreateInstance(modalElement);
}
function show(modalElement) {
var modal = getOrCreate(modalElement);
if (modal) {
modal.show();
return true;
}
return false;
}
function hide(modalElement) {
var modal = getOrCreate(modalElement);
if (modal) {
modal.hide();
return true;
}
return false;
}
window.pulseModal = {
getOrCreate: getOrCreate,
show: show,
hide: hide
};
}());