mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 23:03:38 +08:00
FIX: correctly unshrink composer when re-editing post (#26650)
Prior to this fix we were manually expanding the composer but not setting the correct height. This commit adds a new `unshrink` function on the composer service to correctly set the state and the height on the composer model.
This commit is contained in:
parent
8fbdce36a4
commit
4f7cd7b78e
|
@ -847,7 +847,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
|||
opts?.action === Composer.EDIT &&
|
||||
composerModel?.draftKey === opts.draftKey;
|
||||
if (editingExisting) {
|
||||
composerModel.set("composeState", Composer.OPEN);
|
||||
composer.unshrink();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1697,6 +1697,14 @@ export default class ComposerService extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
unshrink() {
|
||||
this.model.set("composeState", Composer.OPEN);
|
||||
document.documentElement.style.setProperty(
|
||||
"--composer-height",
|
||||
this.model.composerHeight
|
||||
);
|
||||
}
|
||||
|
||||
shrink() {
|
||||
if (
|
||||
this.get("model.replyDirty") ||
|
||||
|
|
Loading…
Reference in New Issue
Block a user