Skip to content
Browse files

get rid of useless for..in loop in getStyle

  • Loading branch information...
1 parent 1f73ef0 commit cb327bf32485f7688634a3b44e2845efbae6c21a @gonchuki committed Aug 20, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 Source/Element/Element.Style.js
View
7 Source/Element/Element.Style.js
@@ -114,10 +114,9 @@ Element.implement({
property = (property == 'float' ? floatName : property).camelCase();
var result = this.style[property];
if (!result || property == 'zIndex'){
- result = [];
- for (var style in Element.ShortStyles){
- if (property != style) continue;
- for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s));
+ if (Element.ShortStyles.hasOwnProperty(property)){
+ result = [];
+ for (var s in Element.ShortStyles[property]) result.push(this.getStyle(s));
return result.join(' ');
}
result = this.getComputedStyle(property);

0 comments on commit cb327bf

Please sign in to comment.
Something went wrong with that request. Please try again.