Skip to content

Commit

Permalink
increasing readability
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomcosta committed Apr 8, 2010
1 parent db93cd6 commit 9db6c72
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Source/Element/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,8 @@ Element.implement({
attribute = camels[attribute] || attribute;
if (value == undefined) return this.removeProperty(attribute);
var key = attributes[attribute];
key ? this[key] = value :
bools[attribute] ? this[attribute] = !!value :
this.setAttribute(attribute, '' + value);
(key) ? this[key] = value :
(bools[attribute]) ? this[attribute] = !!value : this.setAttribute(attribute, '' + value);
return this;
},

Expand All @@ -382,8 +381,8 @@ Element.implement({
getProperty: function(attribute){
attribute = camels[attribute] || attribute;
var key = attributes[attribute] || readOnly[attribute];
return key ? this[key] :
bools[attribute] ? !!this[attribute] :
return (key) ? this[key] :
(bools[attribute]) ? !!this[attribute] :
(uriAttrs.test(attribute) ? this.getAttribute(attribute, 2) :
(key = this.getAttributeNode(attribute)) ? key.nodeValue : null) || null;
},
Expand All @@ -396,9 +395,8 @@ Element.implement({
removeProperty: function(attribute){
attribute = camels[attribute] || attribute;
var key = attributes[attribute];
key ? this[key] = '' :
bools[attribute] ? this[attribute] = false :
this.removeAttribute(attribute);
(key) ? this[key] = '' :
(bools[attribute]) ? this[attribute] = false : this.removeAttribute(attribute);
return this;
},

Expand Down

0 comments on commit 9db6c72

Please sign in to comment.