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:
Aman Agrawal
2023-05-30 08:49:44 +05:30
committed by Tim Abbott
parent 7706d64530
commit 839af9ed8d
2 changed files with 6 additions and 7 deletions

View File

@@ -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"));