mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
FIX: ensures toolbar is updated on composer action change (#9402)
This commit is contained in:
parent
5471c065cd
commit
d984848aa9
|
@ -328,7 +328,7 @@ export default Component.extend({
|
|||
$(this.element.querySelector(".d-editor-preview")).off("click.preview");
|
||||
},
|
||||
|
||||
@discourseComputed
|
||||
@discourseComputed("attrs.outletArgs.composer.action")
|
||||
toolbar() {
|
||||
const toolbar = new Toolbar(
|
||||
this.getProperties("site", "siteSettings", "showLink")
|
||||
|
|
|
@ -584,7 +584,7 @@ testCase(`list button with line sequence`, async function(assert, textarea) {
|
|||
assert.equal(textarea.selectionEnd, 18);
|
||||
});
|
||||
|
||||
componentTest("clicking the toggle-direction button toggles the direction", {
|
||||
componentTest("clicking the toggle-direction changes dir from ltr to rtl", {
|
||||
template: "{{d-editor value=value}}",
|
||||
beforeEach() {
|
||||
this.siteSettings.support_mixed_text_direction = true;
|
||||
|
@ -595,8 +595,21 @@ componentTest("clicking the toggle-direction button toggles the direction", {
|
|||
const textarea = find("textarea.d-editor-input");
|
||||
await click("button.toggle-direction");
|
||||
assert.equal(textarea.attr("dir"), "rtl");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("clicking the toggle-direction changes dir from ltr to rtl", {
|
||||
template: "{{d-editor value=value}}",
|
||||
beforeEach() {
|
||||
this.siteSettings.support_mixed_text_direction = true;
|
||||
this.siteSettings.default_locale = "en_US";
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
const textarea = find("textarea.d-editor-input");
|
||||
textarea.attr("dir", "ltr");
|
||||
await click("button.toggle-direction");
|
||||
assert.equal(textarea.attr("dir"), "ltr");
|
||||
assert.equal(textarea.attr("dir"), "rtl");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user