From: Aleksander Ɓukasz Date: Fri, 28 Jun 2013 08:28:14 +0000 (+0200) Subject: Using === instead of isSameNode (not supported in FF) X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/69be72cddc103e106ad80640a85f6a03def3f960?hp=e816ae7584e8b11a1e24efb2f743ac744d80485b Using === instead of isSameNode (not supported in FF) --- diff --git a/modules/documentCanvas/canvas.js b/modules/documentCanvas/canvas.js index be5323a..9177968 100644 --- a/modules/documentCanvas/canvas.js +++ b/modules/documentCanvas/canvas.js @@ -98,7 +98,7 @@ Canvas.prototype.nodeSplit = function(options) { var node = this; if(passed) succeedingNodes.push(node); - if(node.isSameNode(textNode.get(0))) + if(node === textNode.get(0)) passed = true; }); @@ -125,7 +125,7 @@ Canvas.prototype.nodeRemove = function(options) { Canvas.prototype.listCreate = function(options) { var element1 = $(this.content.find('#' + options.start.getId()).get(0)); var element2 = $(this.content.find('#' + options.end.getId()).get(0)); - if(!element1.parent().get(0).isSameNode(element2.parent().get(0))) + if(!element1.parent().get(0) === element2.parent().get(0)) return false; var parent = element1.parent(); @@ -142,7 +142,7 @@ Canvas.prototype.listCreate = function(options) { var canvas = this; parent.contents().each(function() { var node = this; - if(node.isSameNode(element1.get(0))) + if(node === element1.get(0)) place = 'inside'; if(place === 'inside') { var $node; @@ -156,7 +156,7 @@ Canvas.prototype.listCreate = function(options) { $node.attr('wlxml-class', 'item'); nodesToWrap.push($node); } - if(node.isSameNode(element2.get(0))) + if(node === element2.get(0)) return false; }); diff --git a/modules/documentCanvas/canvasNode.js b/modules/documentCanvas/canvasNode.js index bb1cee7..d0e54ff 100644 --- a/modules/documentCanvas/canvasNode.js +++ b/modules/documentCanvas/canvasNode.js @@ -45,7 +45,7 @@ CanvasNode.prototype.setContent = function(content) { } CanvasNode.prototype.isSame = function(other) { - return (other instanceof CanvasNode) && this.dom.get(0).isSameNode(other.dom.get(0)); + return (other instanceof CanvasNode) && this.dom.get(0) === other.dom.get(0); } CanvasNode.prototype.children = function() {