Fix: Store wlxml class with dashes instead of dots
[fnpeditor.git] / modules / documentCanvas / canvas / documentElement.js
index 7e5824b..c881c7f 100644 (file)
@@ -143,14 +143,14 @@ DocumentNodeElement.prototype = new DocumentElement();
 
 $.extend(DocumentNodeElement.prototype, {
     append: function(params) {
-        manipulate(this, params, 'append');
+        return manipulate(this, params, 'append');
     },
     before: function(params) {
-        manipulate(this, params, 'before');
+        return manipulate(this, params, 'before');
 
     },
     after: function(params) {
-        manipulate(this, params, 'after');
+        return manipulate(this, params, 'after');
     },
     children: function() {
         var toret = [];
@@ -197,7 +197,7 @@ $.extend(DocumentNodeElement.prototype, {
     },
     setWlxmlClass: function(klass) {
         if(klass)
-            this.dom().attr('wlxml-class', klass);
+            this.dom().attr('wlxml-class', klass.replace('.', '-'));
         else
             this.dom().removeAttr('wlxml-class');
     },
@@ -341,6 +341,8 @@ $.extend(DocumentTextElement.prototype, {
         succeedingChildren.forEach(function(child) {
             newElement.append(child);
         });
+
+        return {first: parentElement, second: newElement};
     },
 });