diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
commit | cfdfcc529dedff770dc54e78d2900d9a790f5766 (patch) | |
tree | 7b59c282a7823ded1d182aca95da5d55815456b2 /src/G.js | |
parent | 464af8b747389b7fdb569a933591c863b9be0f6b (diff) | |
download | svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.tar.gz svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.zip |
convert everything to es6 classes and imports
Diffstat (limited to 'src/G.js')
-rw-r--r-- | src/G.js | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -1,19 +1,15 @@ -SVG.G = SVG.invent({ - // Initialize node - create: 'g', +import Container from './Container.js' +import Parent from './Parent.js' - // Inherit from - inherit: SVG.Container, - - // Add class methods - extend: { - }, +export default class G extends Container { + constructor (node) { + super(nodeorNew('group', node)) + } +} - // Add parent method - construct: { - // Create a group element - group: function () { - return this.put(new SVG.G()) - } +addFactory(Parent, { + // Create a group element + group: function () { + return this.put(new G()) } }) |