From b27201056cc90b9c0cb542096afe1b32e7b19afa Mon Sep 17 00:00:00 2001 From: Cynthia Lin Date: Sat, 29 Sep 2018 09:19:03 -0700 Subject: [PATCH] attachments ui: Initialize table sorted by Date uploaded column. Previously we only added the active class to the Date uploaded column, thinking it was already sorted by upload date by default. However, it wasn't, so now we explicitly make a call to sort it by upload date to fix an issue with broken sorting. Fixes #10518. --- static/js/attachments_ui.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/attachments_ui.js b/static/js/attachments_ui.js index ee28f896ac..488cd462ad 100644 --- a/static/js/attachments_ui.js +++ b/static/js/attachments_ui.js @@ -56,6 +56,8 @@ function render_attachments_ui() { parent_container: $('#attachments-settings').expectOne(), }).init(); + list.sort('numeric', 'create_time'); + list.add_sort_function("mentioned-in", function (a, b) { var a_m = a.messages[0]; var b_m = b.messages[0];