X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FDomQuery.js;h=25137a05eb64b11eede3cb9a1bc15d533e406e7a;hb=548db99acb22d3a26a190b77728b3b77575d93e1;hp=9169ada350e2e8a1de31538e5bcadad5451fe77d;hpb=8626b2e3098c837f0a146acdbf021fe1507f6839;p=roojs1 diff --git a/Roo/DomQuery.js b/Roo/DomQuery.js index 9169ada350..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"){ @@ -414,8 +418,6 @@ Roo.DomQuery = function(){ 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]+'");'; @@ -423,13 +425,9 @@ Roo.DomQuery = function(){ fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");'; } q = q.replace(tm[0], ""); - }else if(q.substr(0, 1) != '@'){ fn[fn.length] = 'n = getNodes(n, mode, "*");'; } - Roo.log('fn'); - Roo.log(fn); - Roo.log(q); }else{ if(tm){ if(tm[1] == "#"){ @@ -440,19 +438,11 @@ Roo.DomQuery = function(){ q = q.replace(tm[0], ""); } } - Roo.log(modeRe); while(!(mm = q.match(modeRe))){ var matched = false; - Roo.log('mm'); - Roo.log(mm); for(var j = 0; j < tklen; j++){ var t = tk[j]; var m = q.match(t.re); - Roo.log('t'); - Roo.log(t); - - Roo.log('m'); - Roo.log(m); if(m){ fn[fn.length] = t.select.replace(tplRe, function(x, i){ return m[i];