From 528637eb862877ca60cfa311eb54c6384566f831 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sat, 2 Apr 2016 00:38:27 +0200 Subject: doublecheck SVG.parser, use svg element which is not in the dom (#471) --- src/svg.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/svg.js') diff --git a/src/svg.js b/src/svg.js index 4cdf364..1175a62 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1,7 +1,12 @@ // The main wrapping element var SVG = this.SVG = function(element) { if (SVG.supported) { - return new SVG.Doc(element) + element = new SVG.Doc(element) + + if(!SVG.parser.draw) + SVG.prepare() + + return element } } @@ -133,10 +138,15 @@ SVG.prepare = function() { , draw: draw.style('opacity:0;position:fixed;left:100%;top:100%;overflow:hidden') , poly: draw.polyline().node , path: draw.path().node + , native: SVG.create('svg') } } +SVG.parser = { + native: SVG.create('svg') +} + document.addEventListener('DOMContentLoaded', function() { - if(!SVG.parser) + if(!SVG.parser.draw) SVG.prepare() }, false) -- cgit v1.2.3