From: Aleksander Ɓukasz Date: Fri, 25 Apr 2014 13:08:16 +0000 (+0200) Subject: smartxml: minor refactoring - better naming X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/29a87f7c5b2ddddf7c5c738c4747ffd6f6bb35bb?ds=sidebyside;hp=bb204203f5f64dd13b256263fd398e1463d4eaf9 smartxml: minor refactoring - better naming --- diff --git a/src/smartxml/core.js b/src/smartxml/core.js index 9630a77..419b175 100644 --- a/src/smartxml/core.js +++ b/src/smartxml/core.js @@ -106,7 +106,7 @@ var elementNodeTransformations = { detach: function() { var next; - if(this.parent() && this.isSurroundedByTextElements()) { + if(this.parent() && this.isSurroundedByTextNodes()) { next = this.next(); this.prev().appendText(next.getText()); next.detach(); diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 3ee49b7..502eda6 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -122,7 +122,7 @@ $.extend(DocumentNode.prototype, { return myIdx < parentContents.length - 1 ? parentContents[myIdx+1] : null; }, - isSurroundedByTextElements: function() { + isSurroundedByTextNodes: function() { var prev = this.prev(), next = this.next(); return prev && (prev.nodeType === Node.TEXT_NODE) && next && (next.nodeType === Node.TEXT_NODE);