fix(header): append hmsAppsLauncherModal to document.body to fix modal backdrop overlay issue

This commit is contained in:
DevSoftTech Server 2026-08-28 19:34:41 +05:30
parent e865b71500
commit 405226d66c

View File

@ -391,6 +391,20 @@
}
}
function showAppsModal() {
var modalEl = document.getElementById('hmsAppsLauncherModal');
if (modalEl) {
if (modalEl.parentElement !== document.body) {
document.body.appendChild(modalEl);
}
if (window.bootstrap && window.bootstrap.Modal) {
window.bootstrap.Modal.getOrCreateInstance(modalEl).show();
} else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) {
$(modalEl).modal('show');
}
}
}
function openAppsModal() {
var apiUrl = '<?= base_url('api/v1/nursing/nurses') ?>';
fetch(apiUrl)
@ -409,25 +423,11 @@
}
}
updateHdrAppDetails();
var modalEl = document.getElementById('hmsAppsLauncherModal');
if (modalEl) {
if (window.bootstrap && window.bootstrap.Modal) {
window.bootstrap.Modal.getOrCreateInstance(modalEl).show();
} else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) {
$(modalEl).modal('show');
}
}
showAppsModal();
})
.catch(function(err) {
updateHdrAppDetails();
var modalEl = document.getElementById('hmsAppsLauncherModal');
if (modalEl) {
if (window.bootstrap && window.bootstrap.Modal) {
window.bootstrap.Modal.getOrCreateInstance(modalEl).show();
} else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) {
$(modalEl).modal('show');
}
}
showAppsModal();
});
}