diff --git a/web/src/navbar_alerts.js b/web/src/navbar_alerts.js index a87b20ca04..e541d29c16 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_alert import 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.js index 42b0996e51..94a1339237 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); }