mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: resizeable chat drawer (#20160)
This commit implements a requested feature: resizing the chat drawer. The user can now adjust the drawer size to their liking, and the new size will be stored in localstorage so that it persists across refreshes. In addition to this feature, a bug was fixed where the --composer-right margin was not being correctly computed. This bug could have resulted in incorrectly positioned drawer when the composer was expanded. Note that it includes support for RTL.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
|
||||
module("Discourse Chat | Unit | Service | chat-drawer-size", function (hooks) {
|
||||
hooks.beforeEach(function () {
|
||||
this.subject = getOwner(this).lookup("service:chat-drawer-size");
|
||||
});
|
||||
|
||||
test("get size (with default)", async function (assert) {
|
||||
assert.deepEqual(this.subject.size, { width: 400, height: 530 });
|
||||
});
|
||||
|
||||
test("set size", async function (assert) {
|
||||
this.subject.size = { width: 400, height: 500 };
|
||||
assert.deepEqual(this.subject.size, { width: 400, height: 500 });
|
||||
});
|
||||
|
||||
test("min size", async function (assert) {
|
||||
this.subject.size = { width: 100, height: 100 };
|
||||
assert.deepEqual(this.subject.size, { width: 250, height: 300 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user