aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/selector.js')
-rw-r--r--src/selector.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/selector.js b/src/selector.js
index fe87e4e..afe006d 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -6,11 +6,19 @@ SVG.get = function(id) {
// Select elements by query string
SVG.select = function(query, parent) {
- return new SVG.Set(
- SVG.utils.map((parent || document).querySelectorAll(query), function(node) {
- return SVG.adopt(node)
- })
- )
+ return SVG.utils.map((parent || document).querySelectorAll(query), function(node) {
+ return SVG.adopt(node)
+ })
+}
+
+SVG.$$ = function(query, parent) {
+ return SVG.utils.map((parent || document).querySelectorAll(query), function(node) {
+ return SVG.adopt(node)
+ })
+}
+
+SVG.$ = function(query, parent) {
+ return SVG.adopt((parent || document).querySelector(query))
}
SVG.extend(SVG.Parent, {
@@ -18,5 +26,4 @@ SVG.extend(SVG.Parent, {
select: function(query) {
return SVG.select(query, this.node)
}
-
-}) \ No newline at end of file
+})