PDA

View Full Version : [FIXED][3.0.0]Element.getColor no longer accepts empty string prefix - Fix included



vtswingkid
10 Jul 2009, 7:43 AM
Recommend color be set the way it was in 2.2.1.




getColor : function(attr, defaultValue, prefix){
var v = this.getStyle(attr),
//color = prefix || '#',
color = typeof prefix == "undefined" ? "#" : prefix,
h;

if(!v || /transparent|inherit/.test(v)){
return defaultValue;
}
if(/^r/.test(v)){
Ext.each(v.slice(4, v.length -1).split(','), function(s){
h = parseInt(s, 10);
color += (h < 16 ? '0' : '') + h.toString(16);
});
}else{
v = v.replace('#', '');
color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
}
return(color.length > 5 ? color.toLowerCase() : defaultValue);
},

mjlecomte
10 Jul 2009, 10:35 AM
or use isString?



getColor : function(attr, defaultValue, prefix){
var v = this.getStyle(attr),
//color = prefix || '#',
color = isString(prefix) ? prefix : "#" ,
h;

evant
11 Jul 2009, 7:18 PM
Thanks for the report, this is fixed in SVN.

Sachin ks
16 Oct 2013, 10:59 PM
how select color picker?i have to select the colors like how we select the date from date field.



thanks
Sachin