mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 07:18:06 +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 &&
|
opts?.action === Composer.EDIT &&
|
||||||
composerModel?.draftKey === opts.draftKey;
|
composerModel?.draftKey === opts.draftKey;
|
||||||
if (editingExisting) {
|
if (editingExisting) {
|
||||||
composerModel.set("composeState", Composer.OPEN);
|
composer.unshrink();
|
||||||
return;
|
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() {
|
shrink() {
|
||||||
if (
|
if (
|
||||||
this.get("model.replyDirty") ||
|
this.get("model.replyDirty") ||
|
||||||
|
|
Loading…
Reference in New Issue
Block a user