diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index 3cfef3d7..0bc807f0 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -834,6 +834,22 @@ } + function showEmailHistoryModal() { + var $modal = $('#EmailModal'); + if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') { + $modal.modal('show'); + return; + } + if (window.bootstrap && bootstrap.Modal) { + bootstrap.Modal.getOrCreateInstance(document.getElementById('EmailModal')).show(); + } + } + + $('#EmailModal').on('hidden.bs.modal', function () { + $('body').removeClass('modal-open'); + $('.modal-backdrop').remove(); + }); + function getLeadsDataForMailHistory(lead_id){ console.log("******** Inside Fnz :", lead_id); @@ -953,7 +969,7 @@ `; } // Show modal always - new bootstrap.Modal(document.getElementById("EmailModal")).show(); + showEmailHistoryModal(); }) .catch(error => { @@ -963,8 +979,7 @@

No Data Found

`; - let EmailModal = new bootstrap.Modal(document.getElementById("EmailModal")); - EmailModal.show(); + showEmailHistoryModal(); console.error(error); }); } @@ -2146,6 +2161,74 @@ }); }); + -