refactor: Call format_drafts() more directly.

We want the return value from this for the next
commit, so we no longer call `format_drafts` indirectly
from `populate_and_fill`, and we rename the latter
to `render_widgets`.
This commit is contained in:
Steve Howell 2018-12-16 21:11:17 +00:00 committed by Tim Abbott
parent 1584789916
commit ebd6d84326
1 changed files with 3 additions and 3 deletions

View File

@ -285,9 +285,8 @@ exports.launch = function () {
return sorted_formatted_drafts; return sorted_formatted_drafts;
} }
function populate_and_fill() { function render_widgets(drafts) {
$('#drafts_table').empty(); $('#drafts_table').empty();
var drafts = format_drafts(draft_model.get());
var rendered = templates.render('draft_table_body', { var rendered = templates.render('draft_table_body', {
drafts: drafts, drafts: drafts,
draft_lifetime: DRAFT_LIFETIME, draft_lifetime: DRAFT_LIFETIME,
@ -321,7 +320,8 @@ exports.launch = function () {
} }
remove_old_drafts(); remove_old_drafts();
populate_and_fill(); var drafts = format_drafts(draft_model.get());
render_widgets(drafts);
exports.open_modal(); exports.open_modal();
exports.set_initial_element(); exports.set_initial_element();
setup_event_handlers(); setup_event_handlers();