X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/04bf18e5d4d0d3d4a3663b8979eaf98417f44140..aa19ea0b08ad083be37ebc43aa9ba3f2bf63a043:/modules/documentCanvas/canvas/documentElement.js diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 88287b8..f2ef09c 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -49,8 +49,10 @@ $.extend(DocumentElement.prototype, { }, wrapWithNodeElement: function(wlxmlNode) { - this.$element.wrap($('<' + wlxmlNode.tag + ' class="' + wlxmlNode.klass.replace('.', '-') + '">')[0]); - return documentElementFromHTMLElement(this.$element.parent().get(0), this.canvas); + var wrapper = DocumentNodeElement.create({tag: wlxmlNode.tag, klass: wlxmlNode.klass}); + this.$element.replaceWith(wrapper.dom()); + wrapper.append(this); + return wrapper; }, childIndex: function(child) {