|
|
@ -148,9 +148,9 @@ export default () => { |
|
|
// It's safer putting handlers resolution inside the callback
|
|
|
// It's safer putting handlers resolution inside the callback
|
|
|
const opt = { event: e, h }; |
|
|
const opt = { event: e, h }; |
|
|
handler = isString(handler) ? cmd.get(handler) : handler; |
|
|
handler = isString(handler) ? cmd.get(handler) : handler; |
|
|
opts.prevent && canvas.getCanvasView().preventDefault(e); |
|
|
|
|
|
const ableTorun = !em.isEditing() && !editor.Canvas.isInputFocused(); |
|
|
const ableTorun = !em.isEditing() && !editor.Canvas.isInputFocused(); |
|
|
if (ableTorun || opts.force) { |
|
|
if (ableTorun || opts.force) { |
|
|
|
|
|
opts.prevent && canvas.getCanvasView().preventDefault(e); |
|
|
typeof handler == 'object' |
|
|
typeof handler == 'object' |
|
|
? handler.run(editor, 0, opt) |
|
|
? handler.run(editor, 0, opt) |
|
|
: handler(editor, 0, opt); |
|
|
: handler(editor, 0, opt); |
|
|
|