X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FDomQuery.js;h=25137a05eb64b11eede3cb9a1bc15d533e406e7a;hb=548db99acb22d3a26a190b77728b3b77575d93e1;hp=30acee93c3968376833bb75713d651f9cacbe499;hpb=afd9847ce7f4dea9ea0ef4dc5803fcea6f213809;p=roojs1 diff --git a/Roo/DomQuery.js b/Roo/DomQuery.js index 30acee93c3..25137a05eb 100644 --- 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++){ - if((' '+ci.className+' ').indexOf(v) != -1){ + + + if((' '+ + ( (ci instanceof SVGElement) ? ci.className.baseVal : ci.className) + +' ').indexOf(v) != -1){ r[++ri] = ci; } } @@ -146,7 +150,7 @@ Roo.DomQuery = function(){ 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]; @@ -250,7 +254,7 @@ Roo.DomQuery = function(){ 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"){ @@ -398,19 +402,9 @@ Roo.DomQuery = function(){ var tk = Roo.DomQuery.matchers; var tklen = tk.length; var mm; - Roo.log('path!!!'); - Roo.log(path) - - Roo.log('compile!!!'); - Roo.log(q); + // accept leading mode switch - Roo.log('modeRe'); - Roo.log(modeRe); var lmode = q.match(modeRe); - - Roo.log('lmode'); - Roo.log(lmode); - if(lmode && lmode[1]){ fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";'; q = q.replace(lmode[1], ""); @@ -509,8 +503,6 @@ Roo.DomQuery = function(){ for(var i = 0, len = paths.length; i < len; i++){ var p = paths[i].replace(trimRe, ""); if(!cache[p]){ - Roo.log('p!!!'); - Roo.log(p); cache[p] = Roo.DomQuery.compile(p); if(!cache[p]){ throw p + " is not a valid selector";