diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-27 20:43:35 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-27 20:43:35 +0200 |
commit | 1c75fcaf02ceb144152d59557643c6fdd7264065 (patch) | |
tree | 5184af75f2fd27ca6b81c24a06b1676d17ca2c76 /src/Use.js | |
parent | b1b776a710d0ce0a6259043b8ce0665e205195fa (diff) | |
download | svg.js-1c75fcaf02ceb144152d59557643c6fdd7264065.tar.gz svg.js-1c75fcaf02ceb144152d59557643c6fdd7264065.zip |
resolve circular references and make example working again
Diffstat (limited to 'src/Use.js')
-rw-r--r-- | src/Use.js | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,9 +1,9 @@ -import {Shape, Container} from './classes.js' +import Base from './Base.js' import {xlink} from './namespaces.js' -export default class Use extends Shape { +export default class Use extends Base { constructor (node) { - super(nodeOrNew('use', node)) + super(nodeOrNew('use', node), Use) } // Use element as a reference @@ -13,9 +13,11 @@ export default class Use extends Shape { } } -addFactory(Container, { - // Create a use element - use: function (element, file) { - return this.put(new Use()).element(element, file) +Use.constructors = { + Container: { + // Create a use element + use: function (element, file) { + return this.put(new Use()).element(element, file) + } } -}) +} |