1document.addEventListener('DOMContentLoaded', function() { 2 const button = document.querySelector('.bo_loc_btn'); 3 const filter = document.querySelector('.doanh_nghiep_filter'); 4 const overlay = document.querySelector('.overlay'); 5 const applyFiltersButton = document.querySelector('.apply-filters__button'); 6 7 if (button && filter && overlay) { 8 button.addEventListener('click', function() { 9 filter.classList.toggle('active'); 10 overlay.classList.toggle('active'); 11 }); 12 13 overlay.addEventListener('click', function() { 14 filter.classList.remove('active'); 15 overlay.classList.remove('active'); 16 }); 17 } 18 19 if (applyFiltersButton && filter && overlay) { 20 applyFiltersButton.addEventListener('click', function() { 21 filter.classList.remove('active'); 22 overlay.classList.remove('active'); 23 }); 24 } 25});document.addEventListener('DOMContentLoaded', function() { 26 // Function to handle parent-child checkbox relationships 27 function setupCheckboxRelationships() { 28 // Get all parent checkboxes 29 const parentRows = document.querySelectorAll('.jet-list-tree__parent'); 30 31 parentRows.forEach(parentRow => { 32 const parentCheckbox = parentRow.querySelector('.jet-checkboxes-list__input'); 33 const childrenContainer = parentRow.nextElementSibling; 34 35 if (!childrenContainer || !childrenContainer.classList.contains('jet-list-tree__children')) { 36 return; // Skip if no children container found 37 } 38 39 const childCheckboxes = childrenContainer.querySelectorAll('.jet-checkboxes-list__input'); 40 41 // Handle parent checkbox change 42 parentCheckbox.addEventListener('change', function() { 43 const isChecked = this.checked; 44 45 // Update all child checkboxes 46 childCheckboxes.forEach(childCheckbox => { 47 childCheckbox.checked = isChecked; 48 49 // Trigger change event on child checkboxes to update any listeners 50 const event = new Event('change', { bubbles: true }); 51 childCheckbox.dispatchEvent(event); 52 }); 53 54 // No automatic filtering - user will click the "Lá»c" button manually 55 }); 56 57 // Handle child checkbox changes to update parent 58 childCheckboxes.forEach(childCheckbox => { 59 childCheckbox.addEventListener('change', function() { 60 if (!this.checked) { 61 // If any child is unchecked, uncheck the parent 62 parentCheckbox.checked = false; 63 } else { 64 // Check if all children are checked 65 const allChecked = Array.from(childCheckboxes).every(checkbox => checkbox.checked); 66 parentCheckbox.checked = allChecked; 67 } 68 }); 69 }); 70 }); 71 } 72 73 // We're not triggering filters automatically anymore 74 function triggerJetFiltersUpdate() { 75 // This function is now empty since we don't want to automatically filter 76 // The user will click the "Lá»c" button manually 77 } 78 79 // Initialize the relationships 80 setupCheckboxRelationships(); 81 82 // Additional handler for AJAX loaded content 83 // This helps when filters are loaded dynamically 84 if (typeof JetSmartFilters !== 'undefined') { 85 document.addEventListener('jet-filter-content-rendered', function() { 86 setTimeout(setupCheckboxRelationships, 100); 87 }); 88 } 89}); 90 91 92document.addEventListener('DOMContentLoaded', function() { 93 // Function to handle parent-child checkbox relationships 94 function setupCheckboxRelationships() { 95 // Get all parent checkboxes 96 const parentRows = document.querySelectorAll('.jet-list-tree__parent'); 97 98 parentRows.forEach(parentRow => { 99 const parentCheckbox = parentRow.querySelector('.jet-checkboxes-list__input'); 100 const childrenContainer = parentRow.nextElementSibling; 101 102 if (!childrenContainer || !childrenContainer.classList.contains('jet-list-tree__children')) { 103 return; // Skip if no children container found 104 } 105 106 const childCheckboxes = childrenContainer.querySelectorAll('.jet-checkboxes-l
106ist__input'); 107 108 // Handle parent checkbox change 109 parentCheckbox.addEventListener('change', function() { 110 const isChecked = this.checked; 111 112 // Update all child checkboxes 113 childCheckboxes.forEach(childCheckbox => { 114 childCheckbox.checked = isChecked; 115 116 // Trigger change event on child checkboxes to update any listeners 117 const event = new Event('change', { bubbles: true }); 118 childCheckbox.dispatchEvent(event); 119 }); 120 121 // No automatic filtering - user will click the "Lá»c" button manually 122 }); 123 124 // Handle child checkbox changes to update parent 125 childCheckboxes.forEach(childCheckbox => { 126 childCheckbox.addEventListener('change', function() { 127 if (!this.checked) { 128 // If any child is unchecked, uncheck the parent 129 parentCheckbox.checked = false; 130 } else { 131 // Check if all children are checked 132 const allChecked = Array.from(childCheckboxes).every(checkbox => checkbox.checked); 133 parentCheckbox.checked = allChecked; 134 } 135 }); 136 }); 137 }); 138 } 139 140 // We're not triggering filters automatically anymore 141 function triggerJetFiltersUpdate() { 142 // This function is now empty since we don't want to automatically filter 143 // The user will click the "Lá»c" button manually 144 } 145 146 // Initialize the relationships 147 setupCheckboxRelationships(); 148 149 // Additional handler for AJAX loaded content 150 // This helps when filters are loaded dynamically 151 if (typeof JetSmartFilters !== 'undefined') { 152 document.addEventListener('jet-filter-content-rendered', function() { 153 setTimeout(setupCheckboxRelationships, 100); 154 }); 155 } 156});
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.