1jQuery(document).ready(function ($) { 2 // Select all anchor tags within list items that have a 'menu-item-has-children' class. 3 $("li.menu-item-has-custom-dropdown > a").click(function (e) { 4 // Prevent the default behavior of the anchor tag (following the link). 5 e.preventDefault(); 6 7 // Find the parent list item. 8 var listItem = $(this).parent("li"); 9 10 // Toggle the 'open-submenu' class on the list item. 11 listItem.toggleClass("open-submenu"); 12 }); 13 14 var table = $(".datatable").DataTable({ 15 responsive: { 16 details: { 17 display: DataTable.Responsive.display.childRowImmediate, 18 target: "", 19 type: "none", 20 renderer: function (api, rowIdx, columns) { 21 let data = columns 22 .map((col, i) => { 23 return col.hidden 24 ? '<tr data-dt-row="' + 25 col.rowIndex + 26 '" data-dt-column="' + 27 col.columnIndex + 28 '">' + 29 "<td><b>" + 30 col.title + 31 ":" + 32 "</b></td></tr><tr> " + 33 "<td>" + 34 col.data + 35 "</td>" + 36 "</tr>" 37 : ""; 38 }) 39 .join(""); 40 41 let table = document.createElement("table"); 42 table.innerHTML = data; 43 return data ? table : false; 44 }, 45 }, 46 }, 47 columns: [ 48 { data: "AGI Ranges", className: "desktop" }, 49 { data: "AGI over $350,000", className: "desktop" }, 50 { data: "AGI under $200,000", className: "desktop" }, 51 { data: "AGI $200,000-$350,000", className: "desktop" }, 52 ], 53 paging: false, 54 searching: false, 55 ordering: false, 56 }); 57 58 table.on("responsive-resize.dt", function (e, datatable, columns) { 59 columns.forEach(function (is_visible, index) { 60 $.each($("th", datatable.table().header()), function () { 61 var col = $($(this).children()[index]); 62 is_visible == true ? col.show() : col.hide(); 63 }); 64 }); 65 }); 66 67 // Bind events mobile load more 68 $(document).on("click", ".mobile-pagination a", function (e) { 69 e.preventDefault(); // Prevent default link behavior 70 71 const $el = $(this).parent().parent(); 72 73 // Get the href attribute (the URL for the next page) 74 let href = $("#" + $el.attr("id") + " .pagination .next").attr("href"); 75 76 // last page remove pagination 77 if ($("#" + $el.attr("id") + " .pagination .next").length === 0) { 78 jQuery("#" + $el.attr("id") + " .mobile-pagination").remove(); 79 jQuery("#" + $el.attr("id") + " .pagination").remove(); 80 return false; 81 } 82 83 $el.find(".pagination,.mobile-pagination").remove(); 84 85 window.$el = $el; 86 87 // Perform an AJAX request 88 $.ajax({
89 url: href, // The URL to load 90 type: "GET", 91 beforeSend: function () { 92 // Optionally, show a loader or disable interaction 93 window.$el.addClass("loading"); // Add a loading class for styling 94 }, 95 success: function (response) { 96 // Parse the response to extract new entries 97 let newContent = $(response) 98 .find("#" + window.$el.attr("id")) 99 .html(); // Get the cleaned HTML 100 101 // Append new content to the existing #query-events container event-entry 102 $("#" + window.$el.attr("id") + " .event-entry") 103 .last() 104 .after(newContent); 105 106 // Remove the loading class 107 window.$el.removeClass("loading"); 108 }, 109 error: function () { 110 // Handle errors (e.g., show an error message) 111 alert("Something went wrong. Please try again."); 112 window.$el.removeClass("loading"); 113 }, 114 }); 115 }); 116 117 // Bind click event to all pagination links 118 $(document).on("click", ".pagination a", function (e) { 119 e.preventDefault(); // Prevent default link behavior 120 121 // Get the href attribute (the URL for the next page) 122 let href = $(this).attr("href"); 123 124 const $el = $(this).parent().parent(); 125 126 window.$el = $el; 127 128 // Perform an AJAX request 129 $.ajax({
130 url: href, // The URL to load 131 type: "GET", 132 beforeSend: function () { 133 // Optionally, show a loader or disable interaction 134 window.$el.addClass("loading"); // Add a loading class for styling 135 }, 136 success: function (response) { 137 console.log("success"); 138 console.log(window.$el.attr("id")); 139 // Extract the #query-events content from the response 140 let newContent = $(response) 141 .find("#" + window.$el.attr("id")) 142 .html(); 143 144 // Replace the current #query-events content with the new one 145 window.$el.html(newContent); 146 147 // Remove the loading class 148 window.$el.removeClass("loading"); 149 150 $("html, body").animate( 151 { 152 scrollTop: window.$el.offset().top - 150, 153 }, 154 800 155 ); 156 }, 157 error: function () { 158 // Handle errors (e.g., show an error message) 159 alert("Something went wrong. Please try again."); 160 window.$el.removeClass("loading"); 161 }, 162 }); 163 }); 164 165 // Bind mobile filter 166 $("#select-filters").on("change", function () { 167 let selectedUrl = $(this).val(); // Get selected option value (URL) 168 if (selectedUrl) { 169 window.location.href = selectedUrl; // Redirect to the URL 170 } 171 }); 172 173 if (jQuery(".fancybox").length) { 174 jQuery(".fancybox").fancybox(); 175 } 176});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.