aboutsummaryrefslogtreecommitdiffstats
path: root/src/svg.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-11-06 22:08:38 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-11-06 22:08:38 +0100
commit2702ceb26d3021720f3ff979bcf5f46fc65699e9 (patch)
treecf24afdc5ca280e161347512469f48ba6c80dc8e /src/svg.js
parent042edca2e4e25a293c8d3a55794793636af5b910 (diff)
downloadsvg.js-2702ceb26d3021720f3ff979bcf5f46fc65699e9.tar.gz
svg.js-2702ceb26d3021720f3ff979bcf5f46fc65699e9.zip
svgjs now saves crucial data in the dom (fixes #369 again)
Diffstat (limited to 'src/svg.js')
-rw-r--r--src/svg.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/svg.js b/src/svg.js
index c8454f0..ebe298c 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -14,6 +14,7 @@ var SVG = this.SVG = function(element) {
SVG.ns = 'http://www.w3.org/2000/svg'
SVG.xmlns = 'http://www.w3.org/2000/xmlns/'
SVG.xlink = 'http://www.w3.org/1999/xlink'
+SVG.svgjs = 'http://svgjs.com/svgjs'
// Svg support test
SVG.supported = (function() {
@@ -116,6 +117,9 @@ SVG.adopt = function(node) {
if (element instanceof SVG.Doc)
element.namespace().defs()
+ // pull svgjs data from the dom (getAttributeNS doesn't work in html5)
+ element.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})
+
return element
}