]> source.dussan.org Git - jquery.git/commitdiff
.remove("...") removed too much.
authorJohn Resig <jeresig@gmail.com>
Wed, 10 Jan 2007 16:13:48 +0000 (16:13 +0000)
committerJohn Resig <jeresig@gmail.com>
Wed, 10 Jan 2007 16:13:48 +0000 (16:13 +0000)
src/jquery/jquery.js

index 09005a19160c1777c0b85e089cc298642fa837e2..4543b7228fb3dc4755d0af8c8a377917943b605d 100644 (file)
@@ -1232,13 +1232,15 @@ jQuery.extend({
                                        elem.className += ( elem.className ? " " : "" ) + cur;
                        });
                },
+
                // 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(' ') : "";
+                       elem.className = c ?
+                               jQuery.grep( elem.className.split(/\s+/), function(cur){
+                                       return !jQuery.className.has( c, cur ); 
+                               }).join(' ') : "";
                },
+
                // internal only, use is(".class")
                has: function( t, c ) {
                        t = t.className || t;
@@ -2032,7 +2034,7 @@ jQuery.each( {
                jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
        },
        remove: function(a){
-               if ( !a || jQuery.filter( a, [this] ).r )
+               if ( !a || jQuery.filter( a, [this] ).r.length )
                        this.parentNode.removeChild( this );
        },
        empty: function() {