X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/df0ff2d95fa546b84567c422db9aab4bbd63e8b2..b2aa09d74099e36b7cd45189691d647f33d4688c:/modules/documentCanvas/commands.js diff --git a/modules/documentCanvas/commands.js b/modules/documentCanvas/commands.js index 52f03d8..0c9fef0 100644 --- a/modules/documentCanvas/commands.js +++ b/modules/documentCanvas/commands.js @@ -26,7 +26,9 @@ commands.register('unwrap-node', function(canvas) { parent2 = selectionEnd.element.parent() || undefined; if(canvas.list.areItemsOfTheSameList({element1: parent1, element2: parent2})) { + var selectionAnchor = cursor.getSelectionAnchor(); canvas.list.extractItems({element1: parent1, element2: parent2}); + canvas.setCurrentElement(selectionAnchor.element, {caretTo: selectionAnchor.offset}); } else if(!cursor.isSelecting()) { var toUnwrap = cursor.getPosition().element, parent = toUnwrap.unwrap();