X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b95e2e87d96a747f503990f6f315ade26fe88acc..25dc71d387b1ce0d0fbcdc6e24b462c1f1480ce8:/src/editor/modules/documentCanvas/canvas/keyboard.js 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');