X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e4c946c8c760c8f1d9c2c1a7abfafedafaca21e3..4ff93211ebf44be111ae2c00b7ee9c843ff6d7c9:/src/smartxml/smartxml.js?ds=inline diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index d085742..102a506 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -66,7 +66,7 @@ $.extend(DocumentNode.prototype, { } }); - if(idx !== 'undefined') { + if(idx !== undefined) { nodePath = nodePath.slice(0, idx); } toret = nodePath.map(function(node) {return node.getIndex(); }); @@ -123,6 +123,9 @@ $.extend(DocumentNode.prototype, { var node = (metaData && metaData.node) ? metaData.node : this, event = new events.ChangeEvent(type, $.extend({node: node}, metaData || {})); if(type === 'nodeDetached' || this.document.containsNode(event.meta.node)) { + if(type === 'nodeMoved') { + event.meta.parent = origParent; + } this.document.trigger('change', event); } if((type === 'nodeAdded' || type === 'nodeMoved') && !this.document.containsNode(this) && nodeWasContained) {