From: Corey Frang Date: Sun, 21 Oct 2012 21:46:38 +0000 (-0500) Subject: Effects: Allow 'null' for options - Fixes #8670 - null reference when using effects... X-Git-Tag: 1.9.1~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8b76684a92d7340175284bb369426f0164673b0a;p=jquery-ui.git Effects: Allow 'null' for options - Fixes #8670 - null reference when using effects - Closes gh-783 --- diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index 9b4787a57..c4e5c24f9 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -31,6 +31,17 @@ test( "Immediate Return Conditions", function() { equal( ++count, 3, "Both Functions worked properly" ); }); +asyncTest( "Parse of null for options", function() { + var hidden = $( "div.hidden" ), + count = 0; + expect( 1 ); + hidden.show( "blind", null, 1, function() { + equal( ++count, 1, "null for options still works" ); + start(); + }); +}); + + /* TODO: Disabled - Can't figure out why this is failing in IE 6/7 test( "createWrapper and removeWrapper retain focused elements (#7595)", function() { expect( 2 ); diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 65108e7ba..3fb428c1a 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -1054,8 +1054,8 @@ function _normalizeArguments( effect, options, speed, callback ) { // convert to an object effect = { effect: effect }; - // catch (effect) - if ( options === undefined ) { + // catch (effect, null, ...) + if ( options == null ) { options = {}; }