mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Exit callout/toggle cards on pressing enter
refs https://github.com/TryGhost/Team/issues/1206 - When editing, pressing enter exists the edit mode and adds a new paragraph after the card.
This commit is contained in:
parent
43d1981d73
commit
3024868250
1 changed files with 8 additions and 1 deletions
|
@ -132,7 +132,8 @@ export default class KoenigCardCalloutComponent extends Component {
|
|||
registerEditor(textReplacementEditor) {
|
||||
let commands = {
|
||||
'META+ENTER': run.bind(this, this._enter, 'meta'),
|
||||
'CTRL+ENTER': run.bind(this, this._enter, 'ctrl')
|
||||
'CTRL+ENTER': run.bind(this, this._enter, 'ctrl'),
|
||||
ENTER: run.bind(this, this._addParagraphAfterCard)
|
||||
};
|
||||
|
||||
Object.keys(commands).forEach((str) => {
|
||||
|
@ -166,6 +167,12 @@ export default class KoenigCardCalloutComponent extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
_addParagraphAfterCard() {
|
||||
if (this.args.isEditing) {
|
||||
this.args.addParagraphAfterCard();
|
||||
}
|
||||
}
|
||||
|
||||
_placeCursorAtEnd() {
|
||||
if (!this._textReplacementEditor) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue