From: Aleksander Ɓukasz Date: Sun, 8 Dec 2013 21:34:40 +0000 (+0100) Subject: Removing unnecessary element detach logic from Canvas DocumentNodeElement X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/b33289a3a89915e0418ffe66b34e540aa3ab75ba?ds=sidebyside Removing unnecessary element detach logic from Canvas DocumentNodeElement All of this logic is now handled properly at the wlxml.js level and Canvas reacts accordingly through document events handling. --- diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 1c0719f..210c492 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -195,19 +195,6 @@ $.extend(DocumentNodeElement.prototype, { return this.dom().children('[document-element-content]'); }, detach: function() { - var parent = this.parent(); - if(!parent) - return; - - var parentChildren = parent.children(), - myIdx = parent.childIndex(this); - - if(myIdx > 0 && myIdx < parentChildren.length) { - if((parentChildren[myIdx-1] instanceof DocumentTextElement) && (parentChildren[myIdx+1] instanceof DocumentTextElement)) { - parentChildren[myIdx-1].appendText(parentChildren[myIdx+1].getText()); - parentChildren[myIdx+1].detach(); - } - } this.dom().detach(); this.canvas = null; return this;