Skip to content
Permalink
Browse files
Fix for #1167
  • Loading branch information
brandonaaron committed May 11, 2007
1 parent f5a2db8 commit 009033bb4566079c1f5006ca0e4521ad64117cd0
Showing with 7 additions and 2 deletions.
  1. +6 −1 src/jquery/coreTest.js
  2. +1 −1 src/jquery/jquery.js
@@ -766,7 +766,7 @@ test("addClass(String)", function() {
});

test("removeClass(String) - simple", function() {
expect(2);
expect(3);
var div = $("div").addClass("test").removeClass("test"),
pass = true;
for ( var i = 0; i < div.size(); i++ ) {
@@ -782,6 +782,11 @@ test("removeClass(String) - simple", function() {
if ( div.get(i).className.match(/test|bar|foo/) ) pass = false;
}
ok( pass, "Remove multiple classes" );

reset();
var div = $("div:eq(0)").addClass("test").removeClass("");
ok( div.is('.test'), "Empty string passed to removeClass" );

});

test("toggleClass(String)", function() {
@@ -1349,7 +1349,7 @@ jQuery.extend({

// internal only, use removeClass("class")
remove: function( elem, c ){
elem.className = c ?
elem.className = c != undefined ?
jQuery.grep( elem.className.split(/\s+/), function(cur){
return !jQuery.className.has( c, cur );
}).join(" ") : "";

0 comments on commit 009033b

Please sign in to comment.