Skip to content

Commit 98d16cc

Browse files
committed
Update users.blade.php
1 parent 15e05ac commit 98d16cc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

resources/views/panel/users.blade.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,16 @@
170170
</div>
171171
</div>
172172

173-
<script>
174-
document.addEventListener("DOMContentLoaded", function() {
175-
const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
173+
@push('sidebar-scripts')
174+
<script defer>
175+
const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
176176
177-
const comparer = (idx, asc) => (a, b) =>
178-
((v1, v2) =>
179-
v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
180-
)(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
177+
const comparer = (idx, asc) => (a, b) =>
178+
((v1, v2) =>
179+
v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
180+
)(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
181181
182+
document.addEventListener("DOMContentLoaded", function() {
182183
// Find the table and its headers
183184
const table = document.querySelector('table');
184185
const headers = table.querySelectorAll('th');
@@ -215,6 +216,7 @@
215216
.forEach(tr => table.appendChild(tr));
216217
}));
217218
});
218-
</script>
219-
219+
</script>
220+
@endpush
221+
220222
@endsection

0 commit comments

Comments
 (0)