mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 00:23:41 +08:00
DEV: allow custom composer heights in CSS (#18094)
This commit is contained in:
parent
97f094e5ee
commit
9d9c48fcb8
|
@ -1235,8 +1235,11 @@ export default Controller.extend({
|
||||||
this.model.set("reply", opts.topicBody);
|
this.model.set("reply", opts.topicBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The two custom properties below can be overriden by themes/plugins to set different default composer heights.
|
||||||
const defaultComposerHeight =
|
const defaultComposerHeight =
|
||||||
this.model.action === "reply" ? "300px" : "400px";
|
this.model.action === "reply"
|
||||||
|
? "var(--reply-composer-height, 300px)"
|
||||||
|
: "var(--new-topic-composer-height, 400px)";
|
||||||
|
|
||||||
this.set("model.composerHeight", defaultComposerHeight);
|
this.set("model.composerHeight", defaultComposerHeight);
|
||||||
document.documentElement.style.setProperty(
|
document.documentElement.style.setProperty(
|
||||||
|
|
|
@ -65,7 +65,7 @@ acceptance("Composer", function (needs) {
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
document.documentElement.style.getPropertyValue("--composer-height"),
|
document.documentElement.style.getPropertyValue("--composer-height"),
|
||||||
"400px",
|
"var(--new-topic-composer-height, 400px)",
|
||||||
"sets --composer-height to 400px when creating topic"
|
"sets --composer-height to 400px when creating topic"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ acceptance("Composer", function (needs) {
|
||||||
await click(".toggle-fullscreen");
|
await click(".toggle-fullscreen");
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
document.documentElement.style.getPropertyValue("--composer-height"),
|
document.documentElement.style.getPropertyValue("--composer-height"),
|
||||||
"400px",
|
"var(--new-topic-composer-height, 400px)",
|
||||||
"sets --composer-height back to 400px when composer is opened from draft mode"
|
"sets --composer-height back to 400px when composer is opened from draft mode"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user