X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=8f1eeaff2efecd485d2fdd01fda4cb0c7b4ea6b9;hb=refs%2Fheads%2Fwip_alan_T6833_print_layer_map;hp=b106290d361b1d90218bab069597c01b0ff80588;hpb=cf3fc315159d6f38c826064ffab95d686a8bfac7;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index b106290d36..8f1eeaff2e 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -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; }, @@ -14000,7 +14012,7 @@ Roo.util.Format = function(){ */ size : function(value, decimals) { - var sizes = ['b', 'k', 'm', 'g', 't']; + var sizes = ['b', 'k', 'M', 'G', 'T']; if (value == 0) { return 0; }