X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/f7c97ef38dc00ec9b5358ae0bf959a5e6f99271c..b20691e774cac0cbf2ee174472a1b1dbc94fa61b:/modules/documentCanvas/canvasNode.js diff --git a/modules/documentCanvas/canvasNode.js b/modules/documentCanvas/canvasNode.js index 2b108a1..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() { @@ -73,6 +73,10 @@ CanvasNode.prototype.parents = function() { }; +CanvasNode.prototype.isOfClass = function(klass) { + return this.getClass() && this.getClass().substr(0, klass.length) === klass; +} + return { create: function(desc) { return new CanvasNode(desc);