Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
navbar_alerts: Move resize_app to resize.
Anders Kaseorg95785739acf1
diff --git a/web/src/navbar_alerts.js b/web/src/navbar_alerts.jsindex a87b20ca045..e541d29c165 100644--- a/web/src/navbar_alerts.js+++ b/web/src/navbar_alerts.js@@ -10,7 +10,6 @@ import render_navbar_alert_wrapper from "../templates/navbar_alerts/navbar_alertimport render_profile_incomplete_alert_content from "../templates/navbar_alerts/profile_incomplete.hbs";import render_server_needs_upgrade_alert_content from "../templates/navbar_alerts/server_needs_upgrade.hbs";-import * as compose_ui from "./compose_ui";import * as desktop_notifications from "./desktop_notifications";import * as keydown_util from "./keydown_util";import {localstorage} from "./localstorage";@@ -21,22 +20,6 @@ import * as unread_ops from "./unread_ops";import * as unread_ui from "./unread_ui";import * as util from "./util";-/* This is called by resize.js, and thus indirectly when we trigger- * resize events in the logic below. */-export function resize_app() {- const navbar_alerts_height = $("#navbar_alerts_wrapper").height();- document.documentElement.style.setProperty(- "--navbar-alerts-wrapper-height",- navbar_alerts_height + "px",- );-- // If the compose-box is in expanded state,- // reset its height as well.- if (compose_ui.is_full_size()) {- compose_ui.set_compose_box_top(true);- }-}-const show_step = function ($process, step) {$process.find("[data-step]")diff --git a/web/src/resize.js b/web/src/resize.jsindex 42b0996e518..94a13392373 100644--- a/web/src/resize.js+++ b/web/src/resize.js@@ -3,8 +3,8 @@ import $ from "jquery";import * as blueslip from "./blueslip";import * as compose_state from "./compose_state";+import * as compose_ui from "./compose_ui";import * as message_viewport from "./message_viewport";-import * as navbar_alerts from "./navbar_alerts";function get_bottom_whitespace_height() {return message_viewport.height() * 0.4;@@ -144,8 +144,22 @@ export function update_recent_view_filters_height() {$("html").css("--recent-topics-filters-height", `${recent_view_filters_height}px`);}+function resize_navbar_alerts() {+ const navbar_alerts_height = $("#navbar_alerts_wrapper").height();+ document.documentElement.style.setProperty(+ "--navbar-alerts-wrapper-height",+ navbar_alerts_height + "px",+ );++ // If the compose-box is in expanded state,+ // reset its height as well.+ if (compose_ui.is_full_size()) {+ compose_ui.set_compose_box_top(true);+ }+}+export function resize_page_components() {- navbar_alerts.resize_app();+ resize_navbar_alerts();const h = resize_sidebars();resize_bottom_whitespace(h);}