summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/element.js17
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