diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-03-13 21:27:45 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-03 19:13:39 -0400 |
commit | dbe3b7a9d052b7bf0c73ead1ecd43a40152416a0 (patch) | |
tree | f76c02920bea4a7feb58a097fd23c90a8899a23c /src/attributes.js | |
parent | f578e0f99748ec5ae84d750f0922957e5fea25cb (diff) | |
download | jquery-dbe3b7a9d052b7bf0c73ead1ecd43a40152416a0.tar.gz jquery-dbe3b7a9d052b7bf0c73ead1ecd43a40152416a0.zip |
Style edits according to comments from John and rwaldron.
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/attributes.js b/src/attributes.js index 37a6c1e59..d045ca67e 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -320,7 +320,9 @@ jQuery.extend({ var attr = elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined - return attr === null || attr === "undefined" || attr === "null" ? undefined : attr; + return attr === null || attr === "undefined" || attr === "null" ? + undefined : + attr; } } }, @@ -328,10 +330,17 @@ jQuery.extend({ removeAttr: function( elem, name ) { name = jQuery.attrFix[ name ] || name; - jQuery.support.getSetAttribute ? elem.removeAttribute( name ) : + if ( jQuery.support.getSetAttribute ) { + elem.removeAttribute( name ) + } else { // set property to null if getSetAttribute not supported (IE6-7) // setting className to null makes the class "null" - name === "className" ? elem.className = "" : elem.setAttribute( name, null ); + if ( name === "className" ) { + elem.className = "" + } else { + elem.setAttribute( name, null ); + } + } }, attrHooks: { @@ -345,10 +354,7 @@ jQuery.extend({ } }, - // TODO: Check to see if we really need any here. - propFix: { - - }, + propFix: {}, prop: function( elem, name, value ) { @@ -403,10 +409,14 @@ if ( !jQuery.support.getSetAttribute ) { // Action attribute in ie6/7 returns form objects jQuery.attrHooks.action = { get: function( elem ) { - return elem.nodeName === "FORM" ? elem.getAttributeNode("action").nodeValue : elem.getAttribute("action"); + return elem.nodeName === "FORM" ? + elem.getAttributeNode("action").nodeValue : + elem.getAttribute("action"); }, set: function( elem, value ) { - elem.nodeName === "FORM" ? elem.getAttributeNode("action").nodeValue = value : elem.setAttribute("action", value); + elem.nodeName === "FORM" ? + elem.getAttributeNode("action").nodeValue = value : + elem.setAttribute("action", value); return value; } }; |