Revert "list_render: Clean up initialization."

I pushed this risk commit to the end of
a PR that had a bunch of harmless prep
commits at the front, and I didn't make
it clear enough that the last commit (this
one) hadn't been tested thoroughly.

For the list_render widget, we can simplify
the intialization pretty easily (avoid
extra sorts, for example), but the cache aspects
are still tricky on subsequent calls.
This commit is contained in:
Steve Howell
2020-04-13 09:55:25 +00:00
committed by showell
parent 0bf5ad3265
commit 4e11e7ee5b
12 changed files with 100 additions and 84 deletions

View File

@@ -46,7 +46,7 @@ function populate_invites(invites_data) {
const invites_table = $("#admin_invites_table").expectOne();
list_render.create(invites_table, invites_data.invites, {
const invites_list = list_render.create(invites_table, invites_data.invites, {
name: 'admin_invites_list',
modifier: function (item) {
item.invited_absolute_time = timerender.absolute_time(item.invited * 1000);
@@ -64,12 +64,11 @@ function populate_invites(invites_data) {
},
},
parent_container: $("#admin-invites-list").expectOne(),
init_sort: [sort_invitee],
sort_fields: {
invitee: sort_invitee,
},
});
invites_list.sort('invitee');
invites_list.add_sort_function('invitee', sort_invitee);
loading.destroy_indicator($('#admin_page_invites_loading_indicator'));
}