Fix #6833 - print layer map
[roojs1] / roojs-debug.js
index 4c9a82c..8f1eeaf 100644 (file)
@@ -7675,7 +7675,11 @@ if(opt.anim.isAnimated()){
                 }
             }else{
                 if(className && !this.hasClass(className)){
-                    this.dom.className = this.dom.className + " " + className;
+                    if (this.dom instanceof SVGElement) {
+                        this.dom.className.baseVal =this.dom.className.baseVal  + " " + className;
+                    } else {
+                        this.dom.className = this.dom.className + " " + className;
+                    }
                 }
             }
             return this;
@@ -7704,7 +7708,9 @@ if(opt.anim.isAnimated()){
          * @return {Roo.Element} this
          */
         removeClass : function(className){
-            if(!className || !this.dom.className){
+            
+            var cn = this.dom instanceof SVGElement ? this.dom.className.baseVal : this.dom.className;
+            if(!className || !cn){
                 return this;
             }
             if(className instanceof Array){
@@ -7718,8 +7724,11 @@ if(opt.anim.isAnimated()){
                        re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', "g");
                        this.classReCache[className] = re;
                     }
-                    this.dom.className =
-                        this.dom.className.replace(re, " ");
+                    if (this.dom instanceof SVGElement) {
+                        this.dom.className.baseVal = cn.replace(re, " ");
+                    } else {
+                        this.dom.className = cn.replace(re, " ");
+                    }
                 }
             }
             return this;
@@ -7748,6 +7757,9 @@ if(opt.anim.isAnimated()){
          * @return {Boolean} True if the class exists, else false
          */
         hasClass : function(className){
+            if (this.dom instanceof SVGElement) {
+                return className && (' '+this.dom.className.baseVal +' ').indexOf(' '+className+' ') != -1; 
+            } 
             return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1;
         },
 
@@ -13991,6 +14003,7 @@ Roo.util.Format = function(){
         stripTags : function(v){
             return !v ? v : String(v).replace(this.stripTagsRE, "");
         },
+        
         /**
          * Size in Mb,Gb etc.
          * @param {Number} value The number to be formated
@@ -14000,11 +14013,11 @@ Roo.util.Format = function(){
         size : function(value, decimals)
         {
             var sizes = ['b', 'k', 'M', 'G', 'T'];
-            if (v == 0) {
+            if (value == 0) {
                 return 0;
             }
-            var i = parseInt(Math.floor(Math.log(v) / Math.log(1024)));
-            return this.number(v / Math.pow(1024, i) ,decimals) + ' ' + sizes[i];
+            var i = parseInt(Math.floor(Math.log(value) / Math.log(1024)));
+            return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals)   + sizes[i];
         }