mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03: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
@ -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…
Reference in New Issue
Block a user