summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-02-02 17:20:06 +0100
committerwout <wout@impinc.co.uk>2013-02-02 17:20:06 +0100
commit1c9b6af19cd1367a74b91cb88e98ec1bef2d8234 (patch)
treea64ed5b3858018bb2cb4bab85f7fffb0c54c7f2e /src
parent7323d05f9d09141ec81dcd78d09bdba714c1c5dd (diff)
downloadsvg.js-1c9b6af19cd1367a74b91cb88e98ec1bef2d8234.tar.gz
svg.js-1c9b6af19cd1367a74b91cb88e98ec1bef2d8234.zip
Updated opacity() method in sugar module
Diffstat (limited to 'src')
-rw-r--r--src/sugar.js14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/sugar.js b/src/sugar.js
index d53054e..b0c409c 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -54,19 +54,7 @@ var _colorPrefix = function(type, attr) {
},
// Opacity
opacity: function(value) {
- if (['rect', 'ellipse', 'polygon', 'path', 'polyline', 'line', 'text'].indexOf(this.type) > -1) {
- if (value == null)
- return this.attr('fill-opacity');
- else
- this.attr({ 'fill-opacity': value, 'stroke-opacity': value });
- } else {
- if (value == null)
- return this.attr('opacity');
- else
- this.attr('opacity', value);
- }
-
- return this;
+ return this.attr('opacity', value);
}
});