X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/530d5b117e9513fa9282015d3eb231088275c615..34ca0e947bbf0afdc520c025daabbe1221d69628:/modules/documentCanvas/canvas/documentElement.js diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 8a50d23..0e2cb3d 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -19,7 +19,10 @@ $.extend(DocumentElement.prototype, { return this.$element; }, parent: function() { - return documentElementFromHTMLElement(this.$element.parent()[0], this.canvas); + var parents = this.$element.parents('[wlxml-tag]'); + if(parents.length) + return documentElementFromHTMLElement(parents[0], this.canvas); + return null; }, sameNode: function(other) {