From bedc5daf8a42c50c84b8c43b5924c10d07ed0b3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Sun, 14 Jul 2013 14:03:22 +0200 Subject: [PATCH 1/1] Refactoring --- modules/documentCanvas/canvas/canvas.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index 4344730..90dac8c 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -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); -- 2.20.1