UX: adjust sidebar margin to avoid composer height (#17731)

This commit is contained in:
Kris 2022-07-31 23:02:11 -04:00 committed by GitHub
parent 89d43235c4
commit 2743339a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 12 deletions

View File

@ -107,8 +107,9 @@ export default Component.extend(KeyEnterEscape, {
const minHeight = parseInt(getComputedStyle(this.element).minHeight, 10);
size = Math.max(minHeight, size);
["--reply-composer-height", "--new-topic-composer-height"].forEach((prop) =>
document.documentElement.style.setProperty(prop, size ? `${size}px` : "")
document.documentElement.style.setProperty(
"--composer-height",
size ? `${size}px` : ""
);
this._triggerComposerResized();

View File

@ -1259,6 +1259,14 @@ export default Controller.extend({
if (opts.topicBody) {
this.model.set("reply", opts.topicBody);
}
const defaultComposerHeight =
this.model.action === "reply" ? "300px" : "400px";
document.documentElement.style.setProperty(
"--composer-height",
defaultComposerHeight
);
});
return promise;

View File

@ -1,10 +1,6 @@
:root {
--reply-composer-height: 300px;
--new-topic-composer-height: 400px;
}
html.composer-open {
#main-outlet {
padding-bottom: var(--reply-composer-height);
padding-bottom: var(--composer-height);
transition: padding-bottom 250ms ease;
}
}
@ -53,11 +49,7 @@ html.composer-open {
}
&.open {
height: var(--reply-composer-height);
&.edit-title {
// more room when editing the title
height: var(--new-topic-composer-height);
}
height: var(--composer-height);
}
&.closed {

View File

@ -60,6 +60,12 @@
flex: 1;
display: flex;
flex-direction: column;
.composer-open & {
// allows sidebar to scroll to the bottom when the composer is open
margin-bottom: var(--composer-height);
padding-bottom: var(--composer-ipad-padding);
}
}
.sidebar-sections {