projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #6852 - svg support for domquery (gettarget of event)
[roojs1]
/
Roo
/
DomQuery.js
diff --git
a/Roo/DomQuery.js
b/Roo/DomQuery.js
index
c8df796
..
25137a0
100644
(file)
--- a/
Roo/DomQuery.js
+++ b/
Roo/DomQuery.js
@@
-128,7
+128,11
@@
Roo.DomQuery = function(){
}
var r = [], ri = -1, cn;
for(var i = 0, ci; ci = c[i]; i++){
}
var r = [], ri = -1, cn;
for(var i = 0, ci; ci = c[i]; i++){
- if((' '+ci.className+' ').indexOf(v) != -1){
+
+
+ if((' '+
+ ( (ci instanceof SVGElement) ? ci.className.baseVal : ci.className)
+ +' ').indexOf(v) != -1){
r[++ri] = ci;
}
}
r[++ri] = ci;
}
}
@@
-146,7
+150,7
@@
Roo.DomQuery = function(){
return n.htmlFor;
}
if(attr == "class" || attr == "className"){
return n.htmlFor;
}
if(attr == "class" || attr == "className"){
-
return
n.className;
+
return (n instanceof SVGElement) ? n.className.baseVal :
n.className;
}
return n.getAttribute(attr) || n[attr];
}
return n.getAttribute(attr) || n[attr];
@@
-250,7
+254,7
@@
Roo.DomQuery = function(){
a = Roo.DomQuery.getStyle(ci, attr);
}
else if(attr == "class" || attr == "className"){
a = Roo.DomQuery.getStyle(ci, attr);
}
else if(attr == "class" || attr == "className"){
- a = ci.className;
+ a =
(ci instanceof SVGElement) ? ci.className.baseVal :
ci.className;
}else if(attr == "for"){
a = ci.htmlFor;
}else if(attr == "href"){
}else if(attr == "for"){
a = ci.htmlFor;
}else if(attr == "href"){
@@
-414,8
+418,6
@@
Roo.DomQuery = function(){
lq = q;
var tm = q.match(tagTokenRe);
if(type == "select"){
lq = q;
var tm = q.match(tagTokenRe);
if(type == "select"){
- Roo.log('tm');
- Roo.log(tm);
if(tm){
if(tm[1] == "#"){
fn[fn.length] = 'n = quickId(n, mode, root, "'+tm[2]+'");';
if(tm){
if(tm[1] == "#"){
fn[fn.length] = 'n = quickId(n, mode, root, "'+tm[2]+'");';
@@
-423,9
+425,6
@@
Roo.DomQuery = function(){
fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");';
}
q = q.replace(tm[0], "");
fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");';
}
q = q.replace(tm[0], "");
- Roo.log('fn');
- Roo.log(fn);
- Roo.log(q);
}else if(q.substr(0, 1) != '@'){
fn[fn.length] = 'n = getNodes(n, mode, "*");';
}
}else if(q.substr(0, 1) != '@'){
fn[fn.length] = 'n = getNodes(n, mode, "*");';
}