X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/8411d228c0928c0a2d6c280a2f39adacc972ee13..765844777c85210d541321bfed7582c07a1b4b00:/src/editor/modules/documentCanvas/canvas/canvas.js diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index ebede40..bc7e2a7 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -162,6 +162,11 @@ $.extend(Canvas.prototype, Backbone.Events, { //return DocumentTextElement.fromHTMLElement(htmlElement, canvas); return $element.data('canvas-element'); } + + /* experimental */ + if($element.parent().data('canvas-element')) { + return $element.parent().data('canvas-element'); + } }, reloadRoot: function() { @@ -174,7 +179,9 @@ $.extend(Canvas.prototype, Backbone.Events, { triggerKeyEvent: function(keyEvent, selection) { selection = selection || this.getSelection(); - if(selection && (selection.type === 'caret' || selection.type === 'textSelection') && selection.toDocumentFragment().isValid()) { + if(selection && ( + (selection.type === 'caret' || selection.type === 'textSelection') && selection.toDocumentFragment().isValid() + || selection.type == 'nodeSelection')) { keyboard.handleKeyEvent(keyEvent, selection); } },