|
@@ -42,10 +42,10 @@
|
|
|
|
|
|
// do the work...
|
|
|
document.querySelectorAll('th').forEach(th => th.addEventListener('click', (() => {
|
|
|
- const table = th.closest('table');
|
|
|
- Array.from(table.querySelectorAll('tr:nth-child(n+2)'))
|
|
|
- .sort(comparer(Array.from(th.parentNode.children).indexOf(th), this.asc = !this.asc))
|
|
|
- .forEach(tr => table.appendChild(tr) );
|
|
|
+ const table = th.closest('table');
|
|
|
+ Array.from(table.querySelectorAll('tr:nth-child(n+2)'))
|
|
|
+ .sort(comparer(Array.from(th.parentNode.children).indexOf(th), this.asc = !this.asc))
|
|
|
+ .forEach(tr => table.appendChild(tr) );
|
|
|
})));
|
|
|
</script>
|
|
|
</body>
|