try and get ctrl-enter to add a clear all
[roojs1] / Roo / DomQuery.js
index 797c2a9..f26e29e 100644 (file)
@@ -73,7 +73,7 @@ All selectors, attribute filters and pseudos below can be combined infinitely in
     <li> <b>E{display%=2}</b> css value "display" that is evenly divisible by 2</li>
     <li> <b>E{display!=none}</b> css value "display" that does not equal "none"</li>
 </ul>
- * @singleton
+ * @static
  */
 Roo.DomQuery = function(){
     var cache = {}, simpleCache = {}, valueCache = {};
@@ -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], "");
@@ -419,13 +413,10 @@ Roo.DomQuery = function(){
             while(path.substr(0, 1)=="/"){
                 path = path.substr(1);
             }
-            Roo.log('lg!!!');
-            Roo.log(lq);
+
             while(q && lq != q){
                 lq = q;
                 var tm = q.match(tagTokenRe);
-                Roo.log('tm');
-                Roo.log(tm);
                 if(type == "select"){
                     if(tm){
                         if(tm[1] == "#"){
@@ -512,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";