mirror of
https://github.com/jquery/jquery.git
synced 2026-01-25 18:38:07 -05:00
.remove("...") removed too much.
This commit is contained in:
12
src/jquery/jquery.js
vendored
12
src/jquery/jquery.js
vendored
@@ -1232,13 +1232,15 @@ jQuery.extend({
|
||||
// internal only, use addClass("class")
|
||||
add: function( elem, c ){
|
||||
jQuery.each( c.split(/\s+/), function(i, cur){
|
||||
if ( !jQuery.className.has( elem.className, cur ) )
|
||||
elem.className += ( elem.className ? " " : "" ) + cur;
|
||||
});
|
||||
});
|
||||
},
|
||||
// internal only, use removeClass("class")
|
||||
remove: function( elem, c ){
|
||||
},
|
||||
|
||||
// internal only, use removeClass("class")
|
||||
remove: function( elem, c ){
|
||||
elem.className = c ?
|
||||
jQuery.grep( elem.className.split(/\s+/), function(cur){
|
||||
return !jQuery.className.has( c, cur );
|
||||
}).join(' ') : "";
|
||||
},
|
||||
@@ -2032,7 +2034,7 @@ jQuery.each( {
|
||||
removeClass: function(c){
|
||||
jQuery.className.remove(this,c);
|
||||
},
|
||||
toggleClass: function( c ){
|
||||
toggleClass: function( c ){
|
||||
jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
|
||||
},
|
||||
remove: function(a){
|
||||
|
||||
Reference in New Issue
Block a user