From 4ddf36452af460dbc26fd181f2ba3640a7c71374 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 20 Nov 2013 16:57:05 +0100 Subject: [PATCH 1/1] integration wip: handle backspace/delete --- src/editor/modules/documentCanvas/canvas/keyboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index e7f5fe8..16f2f68 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -189,14 +189,14 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE], goto; if(parent.children().length === 1 && parent.children()[0].sameNode(element)) { if(grandParent && grandParent.children().length === 1) { - goto = grandParent.append({text: ''}); + goto = grandParent.data('wlxmlNode').append({text: ''}); } else { goto = element.getNearestTextElement(direction); } - parent.detach(); + parent.data('wlxmlNode').detach(); } else { goto = element.getNearestTextElement(direction); - element.detach(); + element.data('wlxmlNode').detach(); } canvas.setCurrentElement(goto, {caretTo: caretTo}); canvas.publisher('contentChanged'); -- 2.20.1