From 72bc2f64395f74875c17ca57905bee5bd0fe9467 Mon Sep 17 00:00:00 2001 From: nobuti Date: Sat, 27 Oct 2018 04:58:20 +0200 Subject: [PATCH] Loop through all children executing modifiers --- src/element.js | 17 ++++++++++------- 1 file 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 -- 2.39.5