X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/436728b375888873e6e96079a73f12d8adbd7b96..e669605bf75acf5d20b67ce6f9886e9259146615:/src/editor/modules/documentCanvas/canvas/genericElement.js 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;