summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-30 16:00:03 +0100
committerwout <wout@impinc.co.uk>2013-01-30 16:00:03 +0100
commit4a7588695a1b385f41acd6cbbfaf76b38b2a1439 (patch)
tree18cf5704748de3fde71281753809034886377dcf /src/element.js
parent610e40c62cfbd704db39c1516320de5cf61e36bd (diff)
downloadsvg.js-4a7588695a1b385f41acd6cbbfaf76b38b2a1439.tar.gz
svg.js-4a7588695a1b385f41acd6cbbfaf76b38b2a1439.zip
Added visible() and opacity() methods0.4
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/element.js b/src/element.js
index e1e69ec..ac06109 100644
--- a/src/element.js
+++ b/src/element.js
@@ -12,6 +12,9 @@ SVG.Element = function Element(node) {
'fill-opacity': 1,
'stroke-opacity': 1,
'stroke-width': 0,
+ fill: '#000',
+ stroke: '#000',
+ opacity: 1,
x: 0,
y: 0,
cx: 0,
@@ -258,6 +261,10 @@ SVG.extend(SVG.Element, {
return this;
},
+ // Is element visible?
+ visible: function() {
+ return this.node.style.display != 'none';
+ },
// Private: find svg parent by instance
_parent: function(parent) {
var element = this;