diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2011-12-06 15:25:38 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-06 15:25:38 -0500 |
commit | 6c2a501de40a5f6b3ad382e2d309e5a10fce04d0 (patch) | |
tree | c72333c9a1d5d29acd4e3224ddf6d4e4e00db5fe /src/css.js | |
parent | d511613d748a92af04a3f07943f34f9baadc4153 (diff) | |
download | jquery-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.js | 9 |
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({ |