X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/fb3b7d9bff29aa5c99298ce9e4bae53c2eb47a7d..edaa08a1858371fbdd9665a0220cb1b9732dd2dc:/src/smartxml/smartxml.js?ds=inline diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index de70e9b..cfae7c7 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -140,12 +140,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) { + if(type === 'nodeAdded' && !this.document.containsNode(this) && nodeWasContained) { event = new events.ChangeEvent('nodeDetached', {node: node, parent: origParent}); this.document.trigger('change', event); } @@ -176,16 +173,16 @@ ElementNode.prototype = Object.create(DocumentNode.prototype); $.extend(ElementNode.prototype, { nodeType: Node.ELEMENT_NODE, - setData: function(key, value) { + setData: function(arg1, arg2) { if(arguments.length === 2) { - if(_.isUndefined(value)) { - this._$.removeData(key); + if(_.isUndefined(arg2)) { + this._$.removeData(arg1); } else { - this._$.data(key, value); + this._$.data(arg1, arg2); } } else { this._$.removeData(_.keys(this._$.data())); - this._$.data(key); + this._$.data(arg1); } },