mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-04-24 07:07:19 +02:00
Update users.blade.php
This commit is contained in:
parent
15e05aced0
commit
98d16cc7fd
@ -170,15 +170,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
@push('sidebar-scripts')
|
||||||
|
<script defer>
|
||||||
|
const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
|
||||||
|
|
||||||
|
const comparer = (idx, asc) => (a, b) =>
|
||||||
|
((v1, v2) =>
|
||||||
|
v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
|
||||||
|
)(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const getCellValue = (tr, idx) => tr.children[idx].innerText || tr.children[idx].textContent;
|
|
||||||
|
|
||||||
const comparer = (idx, asc) => (a, b) =>
|
|
||||||
((v1, v2) =>
|
|
||||||
v1 !== '' && v2 !== '' && !isNaN(v1) && !isNaN(v2) ? v1 - v2 : v1.toString().localeCompare(v2)
|
|
||||||
)(getCellValue(asc ? a : b, idx), getCellValue(asc ? b : a, idx));
|
|
||||||
|
|
||||||
// Find the table and its headers
|
// Find the table and its headers
|
||||||
const table = document.querySelector('table');
|
const table = document.querySelector('table');
|
||||||
const headers = table.querySelectorAll('th');
|
const headers = table.querySelectorAll('th');
|
||||||
@ -215,6 +216,7 @@
|
|||||||
.forEach(tr => table.appendChild(tr));
|
.forEach(tr => table.appendChild(tr));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
||||||
@endsection
|
@endsection
|
Loading…
x
Reference in New Issue
Block a user