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

@@ -23,7 +23,7 @@ exports.build_default_stream_table = function () {
const stream_ids = stream_data.get_default_stream_ids();
const subs = stream_ids.map(stream_data.get_sub_by_id);
list_render.create(table, subs, {
const streams_list = list_render.create(table, subs, {
name: "default_streams_list",
modifier: function (item) {
const row = $(render_admin_default_streams_list({
@@ -42,8 +42,9 @@ exports.build_default_stream_table = function () {
},
},
parent_container: $("#admin-default-streams-list").expectOne(),
init_sort: ['alphabetic', 'name'],
});
}).init();
streams_list.sort("alphabetic", "name");
loading.destroy_indicator($('#admin_page_default_streams_loading_indicator'));
};