X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/fd6329db57fc3cc1cf2305da8d0127de4f2198e2..7509ad5d22654faa0abd75465de9f3fa632b1f3a:/src/smartxml/core.js diff --git a/src/smartxml/core.js b/src/smartxml/core.js index b5f8c44..dd472ce 100644 --- a/src/smartxml/core.js +++ b/src/smartxml/core.js @@ -3,7 +3,8 @@ define([ ], function() { 'use strict'; - +/* globals Node */ +var TEXT_NODE = Node.TEXT_NODE; var INSERTION = function(implementation) { var toret = function(node) { @@ -81,7 +82,7 @@ var elementNodeTransformations = { this.prev().appendText(next.getText()); next.detach(); } - return DocumentNode.prototype.detach.call(this); + return this.__super__.detach(); }, setTag: function(tagName) { @@ -95,7 +96,7 @@ var elementNodeTransformations = { node.setData(this.getData()); if(this.sameNode(this.document.root)) { - defineDocumentProperties(this.document, node._$); + this.document._defineDocumentProperties(node._$); } this._$.replaceWith(node._$); this._setNativeNode(node._$[0]); @@ -210,7 +211,7 @@ var textNodeTransformations = { _with: {tagName: desc.tagName, attrs: desc.attrs} }); } else { - return DocumentNode.prototype.wrapWith.call(this, desc); + return this.__super__.wrapWith.call(this, desc); } }, @@ -342,7 +343,7 @@ var documentTransformations = { replaceRoot: function(node) { var insertion = this.getNodeInsertion(node); this.root.detach(); - defineDocumentProperties(this, insertion.ofNode._$); + this._defineDocumentProperties(insertion.ofNode._$); insertion.ofNode.triggerChangeEvent('nodeAdded'); return insertion.ofNode; }