diff options
author | wout <wout@impinc.co.uk> | 2013-02-05 17:48:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-02-05 17:48:03 +0100 |
commit | 11fab70a8066e5c7bb0be881b6abb6f90a5c47b0 (patch) | |
tree | 927ceceadf8c551b5fe692125c7b3bf57033fef4 /src/mask.js | |
parent | 87dd4169a0315310cacefefc9b3157428f584c51 (diff) | |
download | svg.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.js | 5 |
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 |