mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
compose: Update max-height when compose banner is displayed.
Othwersie, compose banner will overlap with any breadcrumbs we have below the last message when user is fully scrolled up and compose is at max-height.
This commit is contained in:
@@ -451,12 +451,10 @@ export function initialize() {
|
||||
|
||||
resize.watch_manual_resize("#compose-textarea");
|
||||
|
||||
// Update position of scroll to bottom button based on
|
||||
// height of the compose box.
|
||||
const update_scroll_to_bottom_position = new ResizeObserver(() => {
|
||||
$("#scroll-to-bottom-button-container").css("bottom", $("#compose").outerHeight());
|
||||
});
|
||||
update_scroll_to_bottom_position.observe(document.querySelector("#compose"));
|
||||
// Updates compose max-height and scroll to bottom button position when
|
||||
// there is a change in compose height like when a compose banner is displayed.
|
||||
const update_compose_max_height = new ResizeObserver(resize.reset_compose_message_max_height);
|
||||
update_compose_max_height.observe(document.querySelector("#compose"));
|
||||
|
||||
upload.feature_check($("#compose .compose_upload_file"));
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export function reset_compose_message_max_height(bottom_whitespace_height) {
|
||||
// the last message of the current stream.
|
||||
|
||||
// Compute bottom_whitespace_height if not provided by caller.
|
||||
if (bottom_whitespace_height === undefined) {
|
||||
if (typeof bottom_whitespace_height !== "number") {
|
||||
bottom_whitespace_height = get_bottom_whitespace_height();
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ export function reset_compose_message_max_height(bottom_whitespace_height) {
|
||||
// subtract 10 for the selected message border.
|
||||
bottom_whitespace_height - compose_non_textarea_height - 10,
|
||||
);
|
||||
$("#scroll-to-bottom-button-container").css("bottom", compose_height);
|
||||
}
|
||||
|
||||
export function resize_bottom_whitespace() {
|
||||
|
||||
Reference in New Issue
Block a user