Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

sidebars: Fix truncated lists when notifications panel is visible.

ligmitz91c81eadd084
diff --git a/static/js/panels.js b/static/js/panels.js
index 7110ee0b942..bf3248ce447 100644
--- a/static/js/panels.js
+++ b/static/js/panels.js
@@ -7,6 +7,8 @@ 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 panels_height = $("#panels").height();
$("body > .app").height("calc(100% - " + panels_height + "px)");
@@ -99,13 +101,13 @@ export function initialize() {
e.preventDefault();
$(this).closest(".alert").hide();
notifications.request_desktop_notifications_permission();
- resize_app();
+ $(window).trigger("resize");
});
$(".reject-notifications").on("click", function () {
$(this).closest(".alert").hide();
ls.set("dontAskForNotifications", true);
- resize_app();
+ $(window).trigger("resize");
});
$(".accept-bankruptcy").on("click", function (e) {
@@ -113,7 +115,7 @@ export function initialize() {
$(this).closest(".alert").hide();
$(".bankruptcy-loader").show();
setTimeout(unread_ops.mark_all_as_read, 1000);
- resize_app();
+ $(window).trigger("resize");
});
$("#panels").on("click", ".alert .close, .alert .exit", function (e) {
@@ -124,7 +126,7 @@ export function initialize() {
} else {
$(this).closest(".alert").hide();
}
- resize_app();
+ $(window).trigger("resize");
});
// Treat Enter with links in the panels UI focused like a click.,
@@ -139,5 +141,5 @@ export function initialize() {
export function open($process) {
$("[data-process]").hide();
$process.show();
- resize_app();
+ $(window).trigger("resize");
}
diff --git a/static/js/resize.js b/static/js/resize.js
index d7650908077..07056df32fe 100644
--- a/static/js/resize.js
+++ b/static/js/resize.js
@@ -214,9 +214,9 @@ export function resize_sidebars() {
}
export function resize_page_components() {
+ panels.resize_app();
const h = resize_sidebars();
resize_bottom_whitespace(h);
- panels.resize_app();
}
let _old_width = $(window).width();
diff --git a/static/js/ui_init.js b/static/js/ui_init.js
index 99245179521..94ad657aebf 100644
--- a/static/js/ui_init.js
+++ b/static/js/ui_init.js
@@ -469,6 +469,7 @@ export function initialize_everything() {
people.initialize(page_params.user_id, people_params);
scroll_bar.initialize();
message_viewport.initialize();
+ panels.initialize();
initialize_kitchen_sink_stuff();
echo.initialize();
stream_edit.initialize();
@@ -522,7 +523,6 @@ export function initialize_everything() {
sent_messages.initialize();
hotspots.initialize();
ui.initialize();
- panels.initialize();
typing.initialize();
starred_messages.initialize();
user_status_ui.initialize();