aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2011-12-06 15:25:38 -0500
committerDave Methvin <dave.methvin@gmail.com>2011-12-06 15:25:38 -0500
commit6c2a501de40a5f6b3ad382e2d309e5a10fce04d0 (patch)
treec72333c9a1d5d29acd4e3224ddf6d4e4e00db5fe /src/css.js
parentd511613d748a92af04a3f07943f34f9baadc4153 (diff)
downloadjquery-6c2a501de40a5f6b3ad382e2d309e5a10fce04d0.tar.gz
jquery-6c2a501de40a5f6b3ad382e2d309e5a10fce04d0.zip
Fix #5571. Setters should treat `undefined` as a no-op and be chainable.
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/css.js b/src/css.js
index d31543ea1..b6c5607e4 100644
--- a/src/css.js
+++ b/src/css.js
@@ -17,16 +17,11 @@ var ralpha = /alpha\([^)]*\)/i,
currentStyle;
jQuery.fn.css = function( name, value ) {
- // Setting 'undefined' is a no-op
- if ( arguments.length === 2 && value === undefined ) {
- return this;
- }
-
- return jQuery.access( this, name, value, true, function( elem, name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
- });
+ }, name, value, arguments.length > 1 );
};
jQuery.extend({