git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
db62240
)
Made sure that .remove now uses multiFilter. Fixes bug #4205.
author
John Resig
<jeresig@gmail.com>
Fri, 20 Feb 2009 19:45:29 +0000
(19:45 +0000)
committer
John Resig
<jeresig@gmail.com>
Fri, 20 Feb 2009 19:45:29 +0000
(19:45 +0000)
src/core.js
patch
|
blob
|
history
test/unit/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
ba796bc
..
65960e2
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-1224,7
+1224,7
@@
jQuery.each({
},
remove: function( selector ) {
},
remove: function( selector ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) {
// Prevent memory leaks
jQuery( "*", this ).add([this]).each(function(){
jQuery.event.remove(this);
// Prevent memory leaks
jQuery( "*", this ).add([this]).each(function(){
jQuery.event.remove(this);
diff --git
a/test/unit/core.js
b/test/unit/core.js
index
69a0676
..
9d91c4f
100644
(file)
--- a/
test/unit/core.js
+++ b/
test/unit/core.js
@@
-1713,7
+1713,7
@@
test("jQuery.className", function() {
});
test("remove()", function() {
});
test("remove()", function() {
- expect(6);
+ expect(7);
jQuery("#ap").children().remove();
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 0, "Check remove" );
jQuery("#ap").children().remove();
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 0, "Check remove" );
@@
-1723,6
+1723,9
@@
test("remove()", function() {
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 1, "Check filtered remove" );
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 1, "Check filtered remove" );
+ jQuery("#ap").children().remove("a, code");
+ equals( jQuery("#ap").children().length, 0, "Check multi-filtered remove" );
+
// using contents will get comments regular, text, and comment nodes
equals( jQuery("#nonnodes").contents().length, 3, "Check node,textnode,comment remove works" );
jQuery("#nonnodes").contents().remove();
// using contents will get comments regular, text, and comment nodes
equals( jQuery("#nonnodes").contents().length, 3, "Check node,textnode,comment remove works" );
jQuery("#nonnodes").contents().remove();