From 98a43b54b6cad9a0aa5861e64e2e3e64191abfee Mon Sep 17 00:00:00 2001 From: YashRE42 <33805964+YashRE42@users.noreply.github.com> Date: Sat, 16 May 2020 23:10:13 +0530 Subject: [PATCH] navbar: Extract "render_title_area" from "initialize". This is a prep commit for adding better support for live rerendering, we can now just call "render_title_area" when we need to perform a rerender. --- static/js/tab_bar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/tab_bar.js b/static/js/tab_bar.js index cb456ca54f..0196e019a4 100644 --- a/static/js/tab_bar.js +++ b/static/js/tab_bar.js @@ -150,8 +150,7 @@ exports.update_stream_description = function () { }; exports.initialize = function () { - const filter = narrow_state.filter(); - build_tab_bar(filter); + exports.render_title_area(); // register searchbar click handler $('#search_exit').on("click", function (e) { @@ -161,6 +160,11 @@ exports.initialize = function () { }); }; +exports.render_title_area = function () { + const filter = narrow_state.filter(); + build_tab_bar(filter); +}; + exports.open_search_bar_and_close_narrow_description = function () { $(".navbar-search").addClass("expanded"); $("#tab_list").addClass("hidden");