summaryrefslogtreecommitdiffstats
path: root/src/Use.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-27 20:43:35 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-27 20:43:35 +0200
commit1c75fcaf02ceb144152d59557643c6fdd7264065 (patch)
tree5184af75f2fd27ca6b81c24a06b1676d17ca2c76 /src/Use.js
parentb1b776a710d0ce0a6259043b8ce0665e205195fa (diff)
downloadsvg.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.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Use.js b/src/Use.js
index 9cf1711..5c4fe8e 100644
--- a/src/Use.js
+++ b/src/Use.js
@@ -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)
+ }
}
-})
+}