summaryrefslogtreecommitdiffstats
path: root/src/set.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-25 10:33:35 +0200
committerwout <wout@impinc.co.uk>2014-08-25 10:33:35 +0200
commit7b8e6f1d5afe2472cd1245f9bb73b6d59238e541 (patch)
tree51f85409971875f642315b8cd3b67d8bbf0cc504 /src/set.js
parent7c195432d30bf2c179d2f5c2682b85d76ef9458b (diff)
downloadsvg.js-7b8e6f1d5afe2472cd1245f9bb73b6d59238e541.tar.gz
svg.js-7b8e6f1d5afe2472cd1245f9bb73b6d59238e541.zip
Removed internal references from SVG.Text
Diffstat (limited to 'src/set.js')
-rwxr-xr-xsrc/set.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/set.js b/src/set.js
index 8c055cf..41289dd 100755
--- a/src/set.js
+++ b/src/set.js
@@ -2,7 +2,7 @@ SVG.Set = SVG.invent({
// Initialize
create: function(members) {
// Set initial state
- Array.isArray(members) ?this.members = members : this.clear()
+ Array.isArray(members) ? this.members = members : this.clear()
}
// Add class methods
@@ -40,6 +40,10 @@ SVG.Set = SVG.invent({
return this
}
+ // Get the length of a set
+ , length: function() {
+ return this.members.length
+ }
// Checks if a given element is present in set
, has: function(element) {
return this.index(element) >= 0