diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-05 15:12:58 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-05 15:12:58 +0100 |
commit | 4049e2e6361d5ed9120f1edd02ef96ecc138fa6d (patch) | |
tree | eeaee230519f755a6d8bd655e84fb08335da8bbd /src/sugar.js | |
parent | edc9454ddf9a0fc29a81713b98e15ddfded04bf4 (diff) | |
download | svg.js-4049e2e6361d5ed9120f1edd02ef96ecc138fa6d.tar.gz svg.js-4049e2e6361d5ed9120f1edd02ef96ecc138fa6d.zip |
rework of classes, make events on every object possible
Diffstat (limited to 'src/sugar.js')
-rw-r--r-- | src/sugar.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sugar.js b/src/sugar.js index e5d6b61..6465985 100644 --- a/src/sugar.js +++ b/src/sugar.js @@ -3,6 +3,7 @@ import Runner from './Runner.js' import SVGNumber from './SVGNumber.js' import Matrix from './Matrix.js' import Point from './Point.js' +import Element from './Element.js' import {registerMethods} from './methods.js' // Define list of available attributes for stroke and fill @@ -23,7 +24,7 @@ var sugar = { if (typeof o === 'undefined') { return this } - if (typeof o === 'string' || Color.isRgb(o) || (o && typeof o.fill === 'function')) { + if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) { this.attr(m, o) } else { // set all attributes from sugar.fill and sugar.stroke list @@ -37,7 +38,7 @@ var sugar = { return this } - registerMethods(['Element', 'Runner'], extension) + registerMethods(['Shape', 'Runner'], extension) }) registerMethods(['Element', 'Runner'], { @@ -140,7 +141,7 @@ registerMethods('Path', { } }) -registerMethods(['Parent', 'Runner'], { +registerMethods(['Element', 'Runner'], { // Set font font: function (a, v) { if (typeof a === 'object') { |