mirror of
https://github.com/codex-team/editor.js
synced 2026-03-17 16:10:07 +01:00
keyboard.js upd
This commit is contained in:
parent
f1e95c3038
commit
fb077640ff
3 changed files with 11 additions and 5 deletions
|
|
@ -2641,12 +2641,13 @@ var Keyboard = function (_Module) {
|
|||
|
||||
case _.keyCodes.ENTER:
|
||||
|
||||
_.log('Enter key pressed');
|
||||
|
||||
if (event.shiftKey) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
_.log('Enter key pressed');
|
||||
this.enterPressed(event);
|
||||
break;
|
||||
|
||||
|
|
@ -2681,7 +2682,9 @@ var Keyboard = function (_Module) {
|
|||
key: 'enterPressed',
|
||||
value: function enterPressed(event) {
|
||||
|
||||
if (this.config.toolsConfig[this.config.initialBlock] && this.config.toolsConfig[this.config.initialBlock].enableLineBreaks) {
|
||||
var currentBlock = this.Editor.BlockManager.currentBlock;
|
||||
|
||||
if (this.config.toolsConfig[currentBlock.name] && this.config.toolsConfig[currentBlock.name].enableLineBreaks) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -38,13 +38,14 @@ export default class Keyboard extends Module {
|
|||
|
||||
case _.keyCodes.ENTER:
|
||||
|
||||
_.log('Enter key pressed');
|
||||
|
||||
if (event.shiftKey) {
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
_.log('Enter key pressed');
|
||||
this.enterPressed(event);
|
||||
break;
|
||||
|
||||
|
|
@ -77,7 +78,9 @@ export default class Keyboard extends Module {
|
|||
*/
|
||||
enterPressed(event) {
|
||||
|
||||
if (this.config.toolsConfig[this.config.initialBlock] && this.config.toolsConfig[this.config.initialBlock].enableLineBreaks) {
|
||||
let currentBlock = this.Editor.BlockManager.currentBlock;
|
||||
|
||||
if (this.config.toolsConfig[currentBlock.name] && this.config.toolsConfig[currentBlock.name].enableLineBreaks) {
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue