alllow functions as argument to addKeyboardHandler
This commit is contained in:
parent
baa0c28e69
commit
75e41746e6
1 changed files with 3 additions and 1 deletions
|
|
@ -63,6 +63,8 @@ var KeyBinding = function(editor) {
|
||||||
this.addKeyboardHandler = function(kb, pos) {
|
this.addKeyboardHandler = function(kb, pos) {
|
||||||
if (!kb)
|
if (!kb)
|
||||||
return;
|
return;
|
||||||
|
if (typeof kb == "function" && !kb.handleKeyboard)
|
||||||
|
kb.handleKeyboard = kb;
|
||||||
var i = this.$handlers.indexOf(kb);
|
var i = this.$handlers.indexOf(kb);
|
||||||
if (i != -1)
|
if (i != -1)
|
||||||
this.$handlers.splice(i, 1);
|
this.$handlers.splice(i, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue