From: Aleksander Ɓukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Date: Thu, 26 Jun 2014 07:31:08 +0000 (+0200)
Subject: wlxml: Document's root is always a context root
X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/c193c33cf3e10b222a47de0b971573b66b495cfc?ds=inline;hp=e28164ab55a10982219bd2a00a08010ef0bb8bcc

wlxml: Document's root is always a context root
---

diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js
index df93b3e..262004c 100644
--- a/src/wlxml/wlxml.js
+++ b/src/wlxml/wlxml.js
@@ -33,6 +33,9 @@ var WLXMLDocumentNodeMethods =  {
     isContextRoot: function() {
         var me = this.nodeType === Node.ELEMENT_NODE ? [this] : [],
             toret = false;
+        if(!this.parent()) {
+            return true;
+        }
         me.concat(this.parents()).some(function(node) {
             if(_.isFunction(node.object.isContextRoot) && node.object.isContextRoot(this)) {
                 toret = true;