aboutsummaryrefslogtreecommitdiffstats
path: root/src/mask.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-02-05 17:48:03 +0100
committerwout <wout@impinc.co.uk>2013-02-05 17:48:03 +0100
commit11fab70a8066e5c7bb0be881b6abb6f90a5c47b0 (patch)
tree927ceceadf8c551b5fe692125c7b3bf57033fef4 /src/mask.js
parent87dd4169a0315310cacefefc9b3157428f584c51 (diff)
downloadsvg.js-11fab70a8066e5c7bb0be881b6abb6f90a5c47b0.tar.gz
svg.js-11fab70a8066e5c7bb0be881b6abb6f90a5c47b0.zip
Unbinding an event from an element
Diffstat (limited to 'src/mask.js')
-rw-r--r--src/mask.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mask.js b/src/mask.js
index 5ffd790..c33b93a 100644
--- a/src/mask.js
+++ b/src/mask.js
@@ -12,7 +12,10 @@ SVG.extend(SVG.Element, {
// Distribute mask to svg element
maskWith: function(element) {
- return this.attr('mask', 'url(#' + (element instanceof SVG.Mask ? element : this.parent.mask().add(element)).id + ')');
+ /* use given mask or create a new one */
+ this.mask = element instanceof SVG.Mask ? element : this.parent.mask().add(element);
+
+ return this.attr('mask', 'url(#' + this.mask.id + ')');
}
}); \ No newline at end of file