Skip to content

Commit

Permalink
fix: Only presort tables if sort order is specified
Browse files Browse the repository at this point in the history
Thanks to @kivinen
  • Loading branch information
larseggert committed Mar 25, 2023
1 parent 1425c15 commit 533a4dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ietf/static/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,11 @@ $(document)
const presort_col = $(header_row).children("[data-default-sort]:first");
if (presort_col) {
const order = presort_col.attr("data-default-sort");
$.each(list_instance, (i, e) => {
e.sort(presort_col.attr("data-sort"), { order: order, sortFunction: text_sort });
});
if (order == "asc" || order == "desc") {
$.each(list_instance, (i, e) => {
e.sort(presort_col.attr("data-sort"), { order: order, sortFunction: text_sort });
});
}
}
});

Expand Down

0 comments on commit 533a4dd

Please sign in to comment.