X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/436728b375888873e6e96079a73f12d8adbd7b96..981e87b8a8d4dfca0c816d8bcedcd7c4dbdab9f4:/src/editor/modules/documentCanvas/canvas/genericElement.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/genericElement.js b/src/editor/modules/documentCanvas/canvas/genericElement.js index f115bd4..a2601f8 100644 --- a/src/editor/modules/documentCanvas/canvas/genericElement.js +++ b/src/editor/modules/documentCanvas/canvas/genericElement.js @@ -104,11 +104,9 @@ $.extend(generic, { } if(event.type === 'nodeMoved') { - /* globals Node */ - if(event.meta.node.nodeType === Node.TEXT_NODE) { - actionArg = utils.getElementForTextNode(event.meta.node); - } else { - actionArg = utils.getElementForNode(event.meta.node); + actionArg = utils.getElementForNode(event.meta.node, event.meta.parent); + if(actionArg.sameNode(referenceElement)) { + referenceElement = this.children()[nodeIndex]; } } else { actionArg = event.meta.node;