diff --git a/js/app.js b/js/app.js index edae3f181..be2d09634 100644 --- a/js/app.js +++ b/js/app.js @@ -401,3 +401,57 @@ $(document).ready(function() { // Data Tables new DataTable('.dataTables'); }); + +/* + |--------------------------------------------------------------- + | Nested Modal Fix for ITFlow AJAX Modals + | Each modal gets a unique container, parent modals remain open + |--------------------------------------------------------------- +*/ + +(function() { + if (!window.createAjaxModal) return; + + // Keep original function just in case + const originalCreateAjaxModal = window.createAjaxModal; + + window.createAjaxModal = function(contentHtml) { + // Generate a unique ID for this modal + const modalId = 'ajaxModal_' + Date.now(); + + // Create a new modal container + const $modal = $('