diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index 6ab391f2..8cc249c7 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -215,8 +215,7 @@ table.dataTable tbody td { - Email History @@ -344,6 +343,7 @@ document.addEventListener("DOMContentLoaded", function () { // Handle clicks on dropdown items customDropdown.querySelectorAll('.dropdown-item').forEach(item => { item.addEventListener('click', function(e) { + console.log("##############"); e.preventDefault(); e.stopPropagation(); @@ -358,7 +358,13 @@ document.addEventListener("DOMContentLoaded", function () { if (id) { getLeadsDataForEdit(id, lead_form_type); } - }else{ + }else if (this.classList.contains('btnHistory')) { + let lead_id = this.getAttribute('data-id'); + if(lead_id){ console.log("******** Clicked from td lead_id-", lead_id); getLeadsDataForMailHistory(lead_id); } + else{ console.log("******** Clicked from td but i don`t have lead_id"); } + + } + else{ const onclickAttr = this.getAttribute('onclick'); if (onclickAttr) { eval(onclickAttr); @@ -387,6 +393,16 @@ document.addEventListener("DOMContentLoaded", function () { activeDropdown = null; } }); + + document.addEventListener("click", function(e) { + if (e.target.closest(".btnHistory")) { + let lead_id = e.target.closest(".btnHistory").dataset.id; + console.log("******** in triple dot id available - " + lead_id); + getLeadsDataForMailHistory(lead_id); + } + else{ console.log("******** in triple dot but id not available"); } + }); + }); @@ -462,146 +478,141 @@ document.addEventListener("DOMContentLoaded", function () { window.location.href = url; } - -