From e79db0f2a63f65c17aad77cb720f060ca127474c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KB=20J=C3=B8rgensen?= Date: Mon, 8 Aug 2016 16:32:59 +0200 Subject: [PATCH] Added ability to create a text node with just a string in addSvgElementFromJson(). --- editor/svgcanvas.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index d6604300..e2830ece 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -189,6 +189,8 @@ var selectedElements = []; // // Returns: The new element var addSvgElementFromJson = this.addSvgElementFromJson = function addSvgElementFromJson(data) { + if(typeof(data) == 'string') return svgdoc.createTextNode(data); + var shape = svgedit.utilities.getElem(data.attr.id); // if shape is a path but we need to create a rect/ellipse, then remove the path var current_layer = getCurrentDrawing().getCurrentLayer();