From 27d9dcbb6ce470c99607666a16eeaac0aff608a4 Mon Sep 17 00:00:00 2001
From: Jan Szejko <janek37@gmail.com>
Date: Tue, 28 Feb 2017 15:58:45 +0100
Subject: [PATCH] simplify

---
 src/editor/modules/documentCanvas/canvas/keyboard.js | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

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;
             }
 
-- 
2.20.1