From 428f22c06a5a72b9f036429f84eec9e1deea1c57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 8 Jul 2013 14:02:48 +0200 Subject: [PATCH] Allow for moving elements already inside canvas --- modules/documentCanvas/canvas/documentElement.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 13ed6a6..aca727a 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -70,9 +70,14 @@ DocumentNodeElement.prototype = new DocumentElement(); DocumentTextElement.prototype = new DocumentElement(); var manipulate = function(e, params, action) { - var newElement = DocumentNodeElement.createDOM(params); - e.$element[action](newElement); - return documentElementFromHTMLElement(newElement); + var dom; + if(params instanceof DocumentElement) { + dom = params.dom() + } else { + dom = DocumentNodeElement.createDOM(params); + } + e.$element[action](dom); + return documentElementFromHTMLElement(dom); }; $.extend(DocumentNodeElement.prototype, { -- 2.20.1