diff options
author | Oleg <markelog@gmail.com> | 2013-09-11 05:08:01 +0400 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2013-09-13 01:04:29 +0400 |
commit | cb37994d76afb45efc3b606546349ed4e695c053 (patch) | |
tree | 8deabef18039a4f90b7f8035775dcd4bd3474495 /src/attributes | |
parent | e12746d756ef32124b163136fe49e753b35c7111 (diff) | |
download | jquery-cb37994d76afb45efc3b606546349ed4e695c053.tar.gz jquery-cb37994d76afb45efc3b606546349ed4e695c053.zip |
No ticket: fix code style inconsistencies. Closes gh-1361
Diffstat (limited to 'src/attributes')
-rw-r--r-- | src/attributes/support.js | 2 | ||||
-rw-r--r-- | src/attributes/val.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/attributes/support.js b/src/attributes/support.js index 08c2caf08..376b54ad2 100644 --- a/src/attributes/support.js +++ b/src/attributes/support.js @@ -2,7 +2,7 @@ define([ "../var/support" ], function( support ) { -(function () { +(function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); diff --git a/src/attributes/val.js b/src/attributes/val.js index 65d772cc2..6fc4a84bb 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -49,10 +49,12 @@ jQuery.fn.extend({ // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; + } else if ( typeof val === "number" ) { val += ""; + } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { + val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; }); } |