X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/1fdf24331346d3b0765cdf9061199aa8bd905bc5..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) {