BlockManager removed keyboard handler

This commit is contained in:
Nikita 2018-01-08 17:01:56 +03:00
commit 45dabb74a9
3 changed files with 3 additions and 90 deletions

View file

@ -1321,7 +1321,7 @@ webpackContext.id = 6;
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Module, _, $) {
/* WEBPACK VAR INJECTION */(function(Module, $, _) {
Object.defineProperty(exports, "__esModule", {
value: true
@ -1446,8 +1446,6 @@ var BlockManager = function (_Module) {
var toolInstance = this.Editor.Tools.construct(toolName, data),
block = new _block2.default(toolName, toolInstance);
this.bindEvents(block);
/**
* Apply callback before inserting html
*/
@ -1456,51 +1454,6 @@ var BlockManager = function (_Module) {
return block;
}
/**
* Bind Events
* @param {Object} block
*/
}, {
key: 'bindEvents',
value: function bindEvents(block) {
var _this3 = this;
/**
* keydown on block
* @todo move to the keydown module
*/
block.pluginsContent.addEventListener('keydown', function (event) {
return _this3.keyDownOnBlock(event);
}, false);
}
/**
* @todo move to the keydown module
* @param {MouseEvent} event
*/
}, {
key: 'keyDownOnBlock',
value: function keyDownOnBlock(event) {
switch (event.keyCode) {
// case _.keyCodes.ENTER:
// this.enterPressedOnPluginsContent(event);
// break;
case _.keyCodes.DOWN:
case _.keyCodes.RIGHT:
this.navigateNext();
break;
case _.keyCodes.UP:
case _.keyCodes.LEFT:
this.navigatePrevious();
break;
}
}
/**
* Set's caret to the next Block
* Before moving caret, we should check if caret position is at the end of Plugins node
@ -2046,7 +1999,7 @@ var Blocks = function () {
Blocks.displayName = 'Blocks';
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1), __webpack_require__(2)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2), __webpack_require__(1)))
/***/ }),
/* 8 */

File diff suppressed because one or more lines are too long

View file

@ -93,8 +93,6 @@ export default class BlockManager extends Module {
let toolInstance = this.Editor.Tools.construct(toolName, data),
block = new Block(toolName, toolInstance);
this.bindEvents(block);
/**
* Apply callback before inserting html
*/
@ -104,44 +102,6 @@ export default class BlockManager extends Module {
}
/**
* Bind Events
* @param {Object} block
*/
bindEvents(block) {
/**
* keydown on block
* @todo move to the keydown module
*/
block.pluginsContent.addEventListener('keydown', (event) => this.keyDownOnBlock(event), false);
}
/**
* @todo move to the keydown module
* @param {MouseEvent} event
*/
keyDownOnBlock(event) {
switch(event.keyCode) {
// case _.keyCodes.ENTER:
// this.enterPressedOnPluginsContent(event);
// break;
case _.keyCodes.DOWN:
case _.keyCodes.RIGHT:
this.navigateNext();
break;
case _.keyCodes.UP:
case _.keyCodes.LEFT:
this.navigatePrevious();
break;
}
}
/**
* Set's caret to the next Block
* Before moving caret, we should check if caret position is at the end of Plugins node