fix weird selection after delete
[fnpeditor.git] / src / smartxml / fragments.js
index b1befdf..f15a9e8 100644 (file)
@@ -76,17 +76,20 @@ $.extend(RangeFragment.prototype, {
         this.startNode = this.document.getNodeByPath(this.startNodePath);
         this.endNode = this.document.getNodeByPath(this.endNodePath);
     },
-    hasSiblingBoundries: function() {
+    hasSiblingBoundaries: function() {
         return this.isValid() && this.startNode.isSiblingOf(this.endNode);
     },
-    boundriesSiblingParents: function() {
+    hasSameBoundaries: function() {
+        return this.isValid() && this.startNode.sameNode(this.endNode);
+    },
+    boundariesSiblingParents: function() {
         return this.startNode.document.getSiblingParents({
             node1: this.startNode,
             node2: this.endNode
         });
     },
     getCommonParent: function() {
-        var siblingParents = this.boundriesSiblingParents();
+        var siblingParents = this.boundariesSiblingParents();
         if(siblingParents) {
             return siblingParents.node1.parent();
         }