Ticket #202 (closed defect: invalid)
[Error : Invalid argument] in setStyle in IE (solution inside)
| Reported by: | SchizoDuckie | Owned by: | |
|---|---|---|---|
| Type: | defect | Priority: | major |
| Milestone: | Component: | Core | |
| Keywords: | Error Invalid argument IE | Cc: |
Description
I've uncovered and patched a tiny bug preventing [Error : Invalid argument] in IE in some occasions:
setStyle: function(property, value){
switch(property){
case 'opacity': return this.setOpacity(parseFloat(value));
case 'float': property = (window.ie) ? 'styleFloat' : 'cssFloat';
}
property = property.camelCase();
switch($type(value)){
case 'number': if (!['zIndex', 'zoom'].contains(property)) value += 'px'; break;
case 'array': value = 'rgb(' + value.join(',') + ')';
}
this.style.property = value; // change from this.style[property] because of bug in IE.
return this;
},