FIX: set --composer-height when the composer is in collapsed state (#17968)
This commit is contained in:
parent
8626268366
commit
2b43238973
|
@ -107,6 +107,7 @@ export default Component.extend(KeyEnterEscape, {
|
|||
const minHeight = parseInt(getComputedStyle(this.element).minHeight, 10);
|
||||
size = Math.max(minHeight, size);
|
||||
|
||||
this.set("composer.composerHeight", `${size}px`);
|
||||
document.documentElement.style.setProperty(
|
||||
"--composer-height",
|
||||
size ? `${size}px` : ""
|
||||
|
|
|
@ -108,6 +108,7 @@ export default Controller.extend({
|
|||
topic: null,
|
||||
linkLookup: null,
|
||||
showPreview: true,
|
||||
composerHeight: null,
|
||||
forcePreview: and("site.mobileView", "showPreview"),
|
||||
whisperOrUnlistTopic: or("isWhispering", "model.unlistTopic"),
|
||||
categories: alias("site.categoriesList"),
|
||||
|
@ -496,6 +497,10 @@ export default Controller.extend({
|
|||
}
|
||||
|
||||
this.set("model.composeState", Composer.OPEN);
|
||||
document.documentElement.style.setProperty(
|
||||
"--composer-height",
|
||||
this.get("model.composerHeight")
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1274,6 +1279,7 @@ export default Controller.extend({
|
|||
const defaultComposerHeight =
|
||||
this.model.action === "reply" ? "300px" : "400px";
|
||||
|
||||
this.set("model.composerHeight", defaultComposerHeight);
|
||||
document.documentElement.style.setProperty(
|
||||
"--composer-height",
|
||||
defaultComposerHeight
|
||||
|
@ -1488,6 +1494,7 @@ export default Controller.extend({
|
|||
collapse() {
|
||||
this._saveDraft();
|
||||
this.set("model.composeState", Composer.DRAFT);
|
||||
document.documentElement.style.setProperty("--composer-height", "40px");
|
||||
},
|
||||
|
||||
toggleFullscreen() {
|
||||
|
|
Loading…
Reference in New Issue