Refactoring
[fnpeditor.git] / modules / documentCanvas / canvas / canvas.js
index 4344730..90dac8c 100644 (file)
@@ -61,9 +61,8 @@ $.extend(Canvas.prototype, {
                         }
                     }
 
-                    var wrapper = documentElement.DocumentTextElement.create({text: this.data});
-                    $(this).before(wrapper.dom());
-                    $(this).remove();
+                    var element = documentElement.DocumentTextElement.create({text: this.data});
+                    $(this).replaceWith(element.dom());
                 });
             
             this.d = wrapper.children(0);