mirror of https://github.com/zulip/zulip.git
narrow: Call reset_ui_state at start of narrowing process.
Continuing the efforts to reduce dom trashing from the previous commits, here we remove the third forced reflow by reordering the call to $(".top-messages-logo").show() via narrow.reset_ui_state(), such that it happens before the other DOM writes in recent_topics_ui.hide(). Tweaked by tabbott to avoid adding an unnecessary if/else statement around recent_topics_ui.hide.
This commit is contained in:
parent
d466627fe2
commit
089fdc4d94
|
@ -192,10 +192,10 @@ run_test("basics", () => {
|
|||
assert.equal(narrow_state.narrowed_to_pms(), false);
|
||||
|
||||
helper.assert_events([
|
||||
[notifications, "clear_compose_notifications"],
|
||||
[notifications, "redraw_title"],
|
||||
[message_scroll, "hide_top_of_narrow_notices"],
|
||||
[message_scroll, "hide_indicators"],
|
||||
[notifications, "clear_compose_notifications"],
|
||||
[notifications, "redraw_title"],
|
||||
[ui_util, "change_tab_to"],
|
||||
[unread_ops, "process_visible"],
|
||||
[hashchange, "save_narrow"],
|
||||
|
|
|
@ -197,6 +197,7 @@ export function activate(raw_operators, opts) {
|
|||
|
||||
const start_time = new Date();
|
||||
|
||||
reset_ui_state();
|
||||
if (recent_topics_util.is_visible()) {
|
||||
recent_topics_ui.hide();
|
||||
}
|
||||
|
@ -218,7 +219,6 @@ export function activate(raw_operators, opts) {
|
|||
const operators = filter.operators();
|
||||
|
||||
update_narrow_title(filter);
|
||||
reset_ui_state();
|
||||
|
||||
blueslip.debug("Narrowed", {
|
||||
operators: operators.map((e) => e.operator),
|
||||
|
|
Loading…
Reference in New Issue