Refactoring
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 14 Jul 2013 12:03:22 +0000 (14:03 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 14 Jul 2013 13:12:25 +0000 (15:12 +0200)
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);