diff options
Diffstat (limited to 'src/elements/Element.js')
-rw-r--r-- | src/elements/Element.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/elements/Element.js b/src/elements/Element.js index 7a563d6..e3a4211 100644 --- a/src/elements/Element.js +++ b/src/elements/Element.js @@ -25,9 +25,13 @@ export default class Element extends Dom { // create circular reference this.node.instance = this - if (node.hasAttribute('svgjs:data')) { + if (node.hasAttribute('data-svgjs') || node.hasAttribute('svgjs:data')) { // pull svgjs data from the dom (getAttributeNS doesn't work in html5) - this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {}) + this.setData( + JSON.parse(node.getAttribute('data-svgjs')) ?? + JSON.parse(node.getAttribute('svgjs:data')) ?? + {} + ) } } |