X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e4c946c8c760c8f1d9c2c1a7abfafedafaca21e3..4b866f317d1e2e774e55127ba6bf598d61b363d8:/src/smartxml/smartxml.js 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) {