aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/adopter.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 19:49:49 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 19:49:49 +0100
commit09e7d0b595da5a2e86e375ea4bd9bd7aba02c588 (patch)
treeae4d2df2887187bed13756c0cc79657cca680cf2 /src/utils/adopter.js
parent8c81fb7c2e6e9842570d27a84b1a1c600c82c16b (diff)
downloadsvg.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/utils/adopter.js')
-rw-r--r--src/utils/adopter.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/adopter.js b/src/utils/adopter.js
index 6880399..88cd383 100644
--- a/src/utils/adopter.js
+++ b/src/utils/adopter.js
@@ -126,7 +126,7 @@ export function wrapWithAttrCheck (fn) {
return function (...args) {
let o = args[args.length - 1]
- if (o && !o.prototype && !(o instanceof Array) && typeof o === 'object') {
+ if (o && o.constructor === Object && !(o instanceof Array)) {
return fn.apply(this, args.slice(0, -1)).attr(o)
} else {
return fn.apply(this, args)