keyboard.js upd

This commit is contained in:
Nikita (@Filolace) 2018-01-12 16:28:16 +03:00
commit fb077640ff
3 changed files with 11 additions and 5 deletions

View file

@ -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

View file

@ -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;