From 1dfb9c497ad66a5c0025e806bd6ee4777baaf1aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 27 Jan 2014 12:03:04 +0100 Subject: [PATCH] editor: fix - block removing root node via insert/delete --- src/editor/modules/documentCanvas/canvas/keyboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 6b55909..c815489 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -249,6 +249,9 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE], event.preventDefault(); var parent = element.parent(), grandParent = parent ? parent.parent() : null; + if(!grandParent && parent.children().length === 1) { + return; + } if(parent.children().length === 1 && parent.children()[0].sameNode(element)) { if(grandParent && grandParent.children().length === 1) { goto = grandParent.data('wlxmlNode').append({text: ''}); -- 2.20.1