From: David Petersen Date: Sat, 26 Jan 2013 17:59:08 +0000 (-0600) Subject: Effects Core: make removeClass work correctly with changes jQuery 1.9.0. Fixed #9015... X-Git-Tag: 1.10.1~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F895%2Fhead;p=jquery-ui.git Effects Core: make removeClass work correctly with changes jQuery 1.9.0. Fixed #9015 - Inclusion of jQuery UI breaks removeClass --- diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index 26390b7d3..c9b1e1b4a 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -38,6 +38,17 @@ asyncTest( "Parse of null for options", function() { }); }); +test( "removeClass", function() { + expect( 3 ); + + var element = $( "
" ); + equal( "", element[ 0 ].className ); + element.addClass( "destroyed" ); + equal( "destroyed", element[ 0 ].className ); + element.removeClass(); + equal( "", element[ 0 ].className ); +}); + /* TODO: Disabled - Can't figure out why this is failing in IE 6/7 test( "createWrapper and removeWrapper retain focused elements (#7595)", function() { diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index c6623a0a1..97f006ee0 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -849,10 +849,10 @@ $.fn.extend({ _removeClass: $.fn.removeClass, removeClass: function( classNames, speed, easing, callback ) { - return speed ? + return arguments.length > 1 ? $.effects.animateClass.call( this, { remove: classNames }, speed, easing, callback ) : - this._removeClass( classNames ); + this._removeClass.apply( this, arguments ); }, _toggleClass: $.fn.toggleClass,