From 0624f436337446e5f98d0ab2bfd6de2feebc9cb1 Mon Sep 17 00:00:00 2001 From: YashRE42 <33805964+YashRE42@users.noreply.github.com> Date: Fri, 26 Nov 2021 18:46:42 +0530 Subject: [PATCH] refactor: Reorder ui state reset calls in narrow.deactivate(). This is a prep commit towards extracting a reset_ui_state function which we can call from here, narrow.activate(), recent_topics.show() and recent_topics.hide(). We want that function because it will enables us to prevent a forced reflow when navigating from recent_topics to stream: xyz. --- static/js/narrow.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/static/js/narrow.js b/static/js/narrow.js index 4601bc6eda..222f29664d 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -812,7 +812,6 @@ function handle_post_narrow_deactivate_processes() { message_view_header.initialize(); narrow_title = "All messages"; notifications.redraw_title(); - message_scroll.hide_top_of_narrow_notices(); message_scroll.update_top_of_narrow_notices(message_lists.home); } @@ -855,15 +854,15 @@ export function deactivate(coming_from_recent_topics = false) { narrow_state.reset_current_filter(); - narrow_banner.hide_empty_narrow_message(); - $("body").removeClass("narrowed_view"); $("#zfilt").removeClass("focused_table"); $("#zhome").addClass("focused_table"); message_lists.set_current(message_lists.home); condense.condense_and_collapse($("#zhome div.message_row")); + narrow_banner.hide_empty_narrow_message(); message_scroll.hide_indicators(); + message_scroll.hide_top_of_narrow_notices(); hashchange.save_narrow(); if (message_lists.current.selected_id() !== -1) {