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
6afc2c07
Commit
6afc2c07
authored
Oct 12, 2011
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #10477. Get `.off(type, null, fn)` right.
parent
d29182e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
event.js
src/event.js
+1
-1
event.js
test/unit/event.js
+13
-2
No files found.
src/event.js
View file @
6afc2c07
...
@@ -953,7 +953,7 @@ jQuery.fn.extend({
...
@@ -953,7 +953,7 @@ jQuery.fn.extend({
}
}
return
this
;
return
this
;
}
}
if
(
typeof
selector
!==
"string
"
)
{
if
(
selector
===
false
||
typeof
selector
===
"function
"
)
{
// ( types [, fn] )
// ( types [, fn] )
fn
=
selector
;
fn
=
selector
;
selector
=
undefined
;
selector
=
undefined
;
...
...
test/unit/event.js
View file @
6afc2c07
...
@@ -704,7 +704,7 @@ test("bind()/trigger()/unbind() on plain object", function() {
...
@@ -704,7 +704,7 @@ test("bind()/trigger()/unbind() on plain object", function() {
});
});
test
(
"unbind(type)"
,
function
()
{
test
(
"unbind(type)"
,
function
()
{
expect
(
0
);
expect
(
1
);
var
$elem
=
jQuery
(
"#firstp"
),
var
$elem
=
jQuery
(
"#firstp"
),
message
;
message
;
...
@@ -736,6 +736,17 @@ test("unbind(type)", function() {
...
@@ -736,6 +736,17 @@ test("unbind(type)", function() {
$elem
.
bind
(
"error1 error2.test"
,
error
)
$elem
.
bind
(
"error1 error2.test"
,
error
)
.
unbind
()
.
unbind
()
.
trigger
(
"error1"
).
triggerHandler
(
"error2"
);
.
trigger
(
"error1"
).
triggerHandler
(
"error2"
);
// Should only unbind the specified function
jQuery
(
document
).
bind
(
"click"
,
function
(){
ok
(
true
,
"called handler after selective removal"
);
});
var
func
=
function
(){
};
jQuery
(
document
)
.
bind
(
"click"
,
func
)
.
unbind
(
"click"
,
func
)
.
click
()
.
unbind
(
"click"
);
});
});
test
(
"unbind(eventObject)"
,
function
()
{
test
(
"unbind(eventObject)"
,
function
()
{
...
...
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