diff options
author | nobuti <buti@nobuti.com> | 2018-10-27 04:58:20 +0200 |
---|---|---|
committer | nobuti <buti@nobuti.com> | 2018-10-27 04:58:20 +0200 |
commit | 72bc2f64395f74875c17ca57905bee5bd0fe9467 (patch) | |
tree | 3004dec51262e31e1a41c8e53993f668f3d87f97 | |
parent | 9e9c9216faef1710bd191a3f9f8ca86f6aa16dba (diff) | |
download | svg.js-72bc2f64395f74875c17ca57905bee5bd0fe9467.tar.gz svg.js-72bc2f64395f74875c17ca57905bee5bd0fe9467.zip |
Loop through all children executing modifiers
-rw-r--r-- | src/element.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/element.js b/src/element.js index 57a83ac..f506cb5 100644 --- a/src/element.js +++ b/src/element.js @@ -273,16 +273,19 @@ SVG.Element = SVG.invent({ } // otherwise act as a getter } else { + // expose node modifiers if (typeof svg === 'function') { - well = svg(this) + this.each(function () { + well = svg(this) - if (well instanceof SVG.Element) { - return well.svg() - } + if (well instanceof SVG.Element) { + this.replace(well) + } - if (typeof well === 'boolean' && !well) { - return null - } + if (typeof well === 'boolean' && !well) { + this.remove() + } + }) } // write svgjs data to the dom |