FIX: Stop using duplicate composer button ID (#11404)
"quote" is used by the button added in `composer-editor`.
bbe5d8d5cf/app/assets/javascripts/discourse/app/components/composer-editor.js (L875-L882)
This commit is contained in:
parent
da9b837da0
commit
1960fc5333
|
@ -104,7 +104,7 @@ class Toolbar {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addButton({
|
this.addButton({
|
||||||
id: "quote",
|
id: "blockquote",
|
||||||
group: "insertions",
|
group: "insertions",
|
||||||
icon: "quote-right",
|
icon: "quote-right",
|
||||||
shortcut: "Shift+9",
|
shortcut: "Shift+9",
|
||||||
|
|
|
@ -459,13 +459,13 @@ third line`
|
||||||
|
|
||||||
textarea.selectionStart = 0;
|
textarea.selectionStart = 0;
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
|
|
||||||
assert.equal(this.value, "> one\n> \n> two\n> \n> three");
|
assert.equal(this.value, "> one\n> \n> two\n> \n> three");
|
||||||
assert.equal(textarea.selectionStart, 0);
|
assert.equal(textarea.selectionStart, 0);
|
||||||
assert.equal(textarea.selectionEnd, 25);
|
assert.equal(textarea.selectionEnd, 25);
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
assert.equal(this.value, "one\n\ntwo\n\nthree");
|
assert.equal(this.value, "one\n\ntwo\n\nthree");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -481,7 +481,7 @@ third line`
|
||||||
textarea.selectionStart = 6;
|
textarea.selectionStart = 6;
|
||||||
textarea.selectionEnd = 10;
|
textarea.selectionEnd = 10;
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
assert.equal(this.value, "one\n\n\n> \n> two");
|
assert.equal(this.value, "one\n\n\n> \n> two");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -490,12 +490,12 @@ third line`
|
||||||
textarea.selectionStart = 6;
|
textarea.selectionStart = 6;
|
||||||
textarea.selectionEnd = 9;
|
textarea.selectionEnd = 9;
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
assert.equal(this.value, "hello\n\n> wor\n\nld.");
|
assert.equal(this.value, "hello\n\n> wor\n\nld.");
|
||||||
assert.equal(textarea.selectionStart, 7);
|
assert.equal(textarea.selectionStart, 7);
|
||||||
assert.equal(textarea.selectionEnd, 12);
|
assert.equal(textarea.selectionEnd, 12);
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
|
|
||||||
assert.equal(this.value, "hello\n\nwor\n\nld.");
|
assert.equal(this.value, "hello\n\nwor\n\nld.");
|
||||||
assert.equal(textarea.selectionStart, 7);
|
assert.equal(textarea.selectionStart, 7);
|
||||||
|
@ -504,7 +504,7 @@ third line`
|
||||||
textarea.selectionStart = 15;
|
textarea.selectionStart = 15;
|
||||||
textarea.selectionEnd = 15;
|
textarea.selectionEnd = 15;
|
||||||
|
|
||||||
await click("button.quote");
|
await click("button.blockquote");
|
||||||
assert.equal(this.value, "hello\n\nwor\n\nld.\n\n> Blockquote");
|
assert.equal(this.value, "hello\n\nwor\n\nld.\n\n> Blockquote");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue