From ebd6d8432621e30b9089c5bb9766cea59915c022 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 16 Dec 2018 21:11:17 +0000 Subject: [PATCH] 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`. --- static/js/drafts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/drafts.js b/static/js/drafts.js index e9828e6bd0..9ec51e9f19 100644 --- a/static/js/drafts.js +++ b/static/js/drafts.js @@ -285,9 +285,8 @@ exports.launch = function () { return sorted_formatted_drafts; } - function populate_and_fill() { + function render_widgets(drafts) { $('#drafts_table').empty(); - var drafts = format_drafts(draft_model.get()); var rendered = templates.render('draft_table_body', { drafts: drafts, draft_lifetime: DRAFT_LIFETIME, @@ -321,7 +320,8 @@ exports.launch = function () { } remove_old_drafts(); - populate_and_fill(); + var drafts = format_drafts(draft_model.get()); + render_widgets(drafts); exports.open_modal(); exports.set_initial_element(); setup_event_handlers();