diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 19:49:49 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 19:49:49 +0100 |
commit | 09e7d0b595da5a2e86e375ea4bd9bd7aba02c588 (patch) | |
tree | ae4d2df2887187bed13756c0cc79657cca680cf2 /src/elements/G.js | |
parent | 8c81fb7c2e6e9842570d27a84b1a1c600c82c16b (diff) | |
download | svg.js-09e7d0b595da5a2e86e375ea4bd9bd7aba02c588.tar.gz svg.js-09e7d0b595da5a2e86e375ea4bd9bd7aba02c588.zip |
added possibility to pass in additional attribues to element creators (#796)
e.g.
- `canvas.rect({x:100})` or
- `canvas.rect(100, 100, {x:100})`
Diffstat (limited to 'src/elements/G.js')
-rw-r--r-- | src/elements/G.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/elements/G.js b/src/elements/G.js index 5eeb65a..6a93a3f 100644 --- a/src/elements/G.js +++ b/src/elements/G.js @@ -1,4 +1,4 @@ -import { nodeOrNew, register } from '../utils/adopter.js' +import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js' import { registerMethods } from '../utils/methods.js' import Container from './Container.js' @@ -11,9 +11,9 @@ export default class G extends Container { registerMethods({ Element: { // Create a group element - group: function () { + group: wrapWithAttrCheck(function () { return this.put(new G()) - } + }) } }) |