Skip to content

Commit

Permalink
fix: Only presort tables if sort order is specified (#5408)
Browse files Browse the repository at this point in the history
Thanks to @kivinen
  • Loading branch information
larseggert committed Mar 31, 2023
1 parent 8b815fc commit 50e716e
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 50e716e

Please sign in to comment.