X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7a55de7fa64363dcc4bdcf31dabe2e155018597a..e28164ab55a10982219bd2a00a08010ef0bb8bcc:/src/wlxml/wlxml.js diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index c38810d..df93b3e 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -24,9 +24,10 @@ var WLXMLDocumentNodeMethods = { me.concat(this.parents()).some(function(node) { if(node.is(query)) { toret = node; - return true; } - }); + return !!toret || (!node.sameNode(this) && node.isContextRoot()); + }.bind(this)); + return toret; }, isContextRoot: function() {