File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 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' );
215216 .forEach (tr => table .appendChild (tr));
216217 }));
217218 });
218- </script >
219-
219+ </script >
220+ @endpush
221+
220222@endsection
You can’t perform that action at this time.
0 commit comments