X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/a3899fd80710d7faee391844c6cb10a67df4f6cb..6b06b64:/src/editor/modules/documentCanvas/canvas/keyboard.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 0871199..0ad2ff3 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -238,22 +238,16 @@ var keyEventHandlers = [ ); }, run: function(e,s) { - var direction, caretTo, cursorAtOperationEdge, goto, element; + var goto, element; if(e.key === KEYS.BACKSPACE) { - direction = 'above'; - caretTo = 'end'; - cursorAtOperationEdge = s.isAtBeginning(); // always true? element = s.element; } else { - direction = 'below'; - caretTo = 'start'; - cursorAtOperationEdge = s.isAtEnd(); // always true? - element = cursorAtOperationEdge && s.canvas.getNearestTextElement(direction, s.element); + element = s.canvas.getNearestTextElement('below', s.element); } - if(!cursorAtOperationEdge || !element) { + if(!element) { return; }