Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
a37ca9e9
Commit
a37ca9e9
authored
Feb 20, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made sure that .remove now uses multiFilter. Fixes bug #4205.
parent
db62240f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+4
-1
No files found.
src/core.js
View file @
a37ca9e9
...
...
@@ -1224,7 +1224,7 @@ jQuery.each({
},
remove
:
function
(
selector
)
{
if
(
!
selector
||
jQuery
.
f
ilter
(
selector
,
[
this
]
).
length
)
{
if
(
!
selector
||
jQuery
.
multiF
ilter
(
selector
,
[
this
]
).
length
)
{
// Prevent memory leaks
jQuery
(
"*"
,
this
).
add
([
this
]).
each
(
function
(){
jQuery
.
event
.
remove
(
this
);
...
...
test/unit/core.js
View file @
a37ca9e9
...
...
@@ -1713,7 +1713,7 @@ test("jQuery.className", 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"
);
...
...
@@ -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"
);
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment