blob: 82aca374fcb3558bc29359a27e842fc67a1238e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Method for getting an element by id
SVG.get = function(id) {
var node = document.getElementById(idFromReference(id) || id)
if (node) return SVG.adopt(node)
}
// Select elements by query string
SVG.select = function(query, parent) {
return SVG.utils.map((parent || document).querySelectorAll(query), function(node) {
return SVG.adopt(node)
})
}
SVG.extend(SVG.Parent, {
// Scoped select method
select: function(query) {
return SVG.select(query, this.node)
}
})
|