From 1726f584bb8ff2770506aae2e77fe27fbfd5ab98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 19 Nov 2013 16:03:04 +0100 Subject: [PATCH] integration wip: take-away-node command --- src/editor/modules/documentCanvas/commands.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index 6ff1d86..ac56a31 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -151,7 +151,7 @@ commands.register('take-away-node', function(canvas) { return; - var range = nodeElement.unwrapContents(); + var range = nodeElement.data('wlxmlNode').unwrapContent(); if(element) { var elementIsFirstChild = nodeElement.childIndex(element); @@ -159,13 +159,13 @@ commands.register('take-away-node', function(canvas) { canvas.setCurrentElement(element, {caretTo: position.offset}); } else { if(elementIsFirstChild) { - canvas.setCurrentElement(range.element1, {caretTo: 'end'}); + canvas.setCurrentElement(findCanvasElement(range.element1), {caretTo: 'end'}); } else { - canvas.setCurrentElement(range.element2, {caretTo: 'end'}); + canvas.setCurrentElement(findCanvasElement(range.element2), {caretTo: 'end'}); } } } else { - canvas.setCurrentElement(range.element1, {caretTo: 'start'}); + canvas.setCurrentElement(findCanvasElement(range.element1), {caretTo: 'start'}); } }); -- 2.20.1