UX: remove 🔥heading and ruler button from composer toolbar
This commit is contained in:
parent
4205c1ad2b
commit
62156885ec
|
@ -101,24 +101,6 @@ class Toolbar {
|
|||
perform: e => e.applyList(i => !i ? "1. " : `${parseInt(i) + 1}. `, 'list_item')
|
||||
});
|
||||
|
||||
this.addButton({
|
||||
id: 'heading',
|
||||
group: 'extras',
|
||||
icon: 'header',
|
||||
label: getButtonLabel('composer.heading_label', 'H'),
|
||||
shortcut: 'Alt+1',
|
||||
perform: e => e.applyList('## ', 'heading_text')
|
||||
});
|
||||
|
||||
this.addButton({
|
||||
id: 'rule',
|
||||
group: 'extras',
|
||||
icon: 'minus',
|
||||
shortcut: 'Alt+R',
|
||||
title: 'composer.hr_title',
|
||||
perform: e => e.addText("\n\n----------\n")
|
||||
});
|
||||
|
||||
if (site.mobileView) {
|
||||
this.groups.push({group: 'mobileExtras', buttons: []});
|
||||
}
|
||||
|
|
|
@ -1253,10 +1253,6 @@ en:
|
|||
olist_title: "Numbered List"
|
||||
ulist_title: "Bulleted List"
|
||||
list_item: "List item"
|
||||
heading_label: "H"
|
||||
heading_title: "Heading"
|
||||
heading_text: "Heading"
|
||||
hr_title: "Horizontal Rule"
|
||||
help: "Markdown Editing Help"
|
||||
toggler: "hide or show the composer panel"
|
||||
modal_ok: "OK"
|
||||
|
|
|
@ -692,66 +692,6 @@ testCase(`list button with line sequence`, function(assert, textarea) {
|
|||
});
|
||||
});
|
||||
|
||||
testCase(`heading button with no selection`, function(assert, textarea) {
|
||||
const example = I18n.t('composer.heading_text');
|
||||
|
||||
click(`button.heading`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n## ${example}`);
|
||||
assert.equal(textarea.selectionStart, 14);
|
||||
assert.equal(textarea.selectionEnd, 17 + example.length);
|
||||
});
|
||||
|
||||
textarea.selectionStart = 30;
|
||||
textarea.selectionEnd = 30;
|
||||
click(`button.heading`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n${example}`);
|
||||
assert.equal(textarea.selectionStart, 14);
|
||||
assert.equal(textarea.selectionEnd, 14 + example.length);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule between things`, function(assert, textarea) {
|
||||
textarea.selectionStart = 5;
|
||||
textarea.selectionEnd = 5;
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello\n\n----------\n world.`);
|
||||
assert.equal(textarea.selectionStart, 18);
|
||||
assert.equal(textarea.selectionEnd, 18);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule with no selection`, function(assert, textarea) {
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n----------\n`);
|
||||
assert.equal(textarea.selectionStart, 25);
|
||||
assert.equal(textarea.selectionEnd, 25);
|
||||
});
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n----------\n\n\n----------\n`);
|
||||
assert.equal(textarea.selectionStart, 38);
|
||||
assert.equal(textarea.selectionEnd, 38);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule with a selection`, function(assert, textarea) {
|
||||
textarea.selectionStart = 6;
|
||||
textarea.selectionEnd = 11;
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello \n\n----------\n.`);
|
||||
assert.equal(textarea.selectionStart, 19);
|
||||
assert.equal(textarea.selectionEnd, 19);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`doesn't jump to bottom with long text`, function(assert, textarea) {
|
||||
|
||||
let longText = 'hello world.';
|
||||
|
|
Loading…
Reference in New Issue