Fix: missing canvas reference
[fnpeditor.git] / modules / documentCanvas / canvas / documentElement.js
index 4d74722..11e3471 100644 (file)
@@ -74,7 +74,7 @@ $.extend(DocumentElement.prototype, {
     },
 
     wrapWithNodeElement: function(wlxmlNode) {
-        var wrapper = DocumentNodeElement.create({tag: wlxmlNode.tag, klass: wlxmlNode.klass});
+        var wrapper = DocumentNodeElement.create({tag: wlxmlNode.tag, klass: wlxmlNode.klass}, this);
         this.dom().replaceWith(wrapper.dom());
         wrapper.append(this);
         return wrapper;
@@ -103,6 +103,12 @@ $.extend(DocumentElement.prototype, {
 
     isVisible: function() {
         return this instanceof DocumentTextElement || this.getWlxmlTag() !== 'metadata';
+    },
+
+    isInsideList: function() {
+        return this.parents().some(function(parent) {
+            return parent.is('list');
+        });
     }
 });