From 3008696314ecd61f93da29ea623b8c2c06ac14d8 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Wed, 25 Jul 2018 17:44:37 -0700 Subject: [PATCH] - Allow template to have text node for readability --- editor/svg-editor.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 223eef37..8258f473 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -4576,9 +4576,11 @@ editor.init = function () { const cur = curConfig[type === 'fill' ? 'initFill' : 'initStroke']; // set up gradients to be used for the buttons const svgdocbox = new DOMParser().parseFromString( - ` + - `, + + `, 'text/xml' ); @@ -4586,9 +4588,9 @@ editor.init = function () { docElem = $(container)[0].appendChild(document.importNode(docElem, true)); docElem.setAttribute('width', 16.5); - this.rect = docElem.firstChild; + this.rect = docElem.firstElementChild; this.defs = docElem.getElementsByTagName('defs')[0]; - this.grad = this.defs.firstChild; + this.grad = this.defs.firstElementChild; this.paint = new $.jGraduate.Paint({solidColor: cur.color}); this.type = type;