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
df4a160b
Commit
df4a160b
authored
Oct 27, 2011
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass correct arg list to special._default. Thanks @mikaelkaron!
parent
736d4d77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
event.js
src/event.js
+1
-1
event.js
test/unit/event.js
+5
-5
No files found.
src/event.js
View file @
df4a160b
...
@@ -365,7 +365,7 @@ jQuery.event = {
...
@@ -365,7 +365,7 @@ jQuery.event = {
// If nobody prevented the default action, do it now
// If nobody prevented the default action, do it now
if
(
!
event
.
isDefaultPrevented
()
)
{
if
(
!
event
.
isDefaultPrevented
()
)
{
if
(
(
!
special
.
_default
||
special
.
_default
.
call
(
elem
.
ownerDocument
,
ev
ent
,
data
)
===
false
)
&&
if
(
(
!
special
.
_default
||
special
.
_default
.
apply
(
elem
.
ownerDocum
ent
,
data
)
===
false
)
&&
!
(
type
===
"click"
&&
jQuery
.
nodeName
(
elem
,
"a"
))
&&
jQuery
.
acceptData
(
elem
)
)
{
!
(
type
===
"click"
&&
jQuery
.
nodeName
(
elem
,
"a"
))
&&
jQuery
.
acceptData
(
elem
)
)
{
// Call a native DOM method on the target with the same name name as the event.
// Call a native DOM method on the target with the same name name as the event.
...
...
test/unit/event.js
View file @
df4a160b
...
@@ -1753,8 +1753,8 @@ test("live with special events", function() {
...
@@ -1753,8 +1753,8 @@ test("live with special events", function() {
remove
:
function
(
handleObj
)
{
remove
:
function
(
handleObj
)
{
ok
(
true
,
"Remove run."
);
ok
(
true
,
"Remove run."
);
},
},
_default
:
function
(
event
)
{
_default
:
function
(
event
,
arg
)
{
ok
(
true
,
"Default run
."
);
ok
(
event
.
type
===
"foo"
&&
arg
==
42
,
"Default run with correct args
."
);
}
}
};
};
...
@@ -1769,16 +1769,16 @@ test("live with special events", function() {
...
@@ -1769,16 +1769,16 @@ test("live with special events", function() {
});
});
// Run: Handler 1, Handler 2, Default
// Run: Handler 1, Handler 2, Default
jQuery
(
"#liveSpan1"
).
trigger
(
"foo"
);
jQuery
(
"#liveSpan1"
).
trigger
(
"foo"
,
42
);
// Run: Handler 1, Default
// Run: Handler 1, Default
jQuery
(
"#liveSpan1"
).
trigger
(
"foo.a"
);
jQuery
(
"#liveSpan1"
).
trigger
(
"foo.a"
,
42
);
// Run: remove
// Run: remove
jQuery
(
"#liveSpan1"
).
die
(
"foo.a"
);
jQuery
(
"#liveSpan1"
).
die
(
"foo.a"
);
// Run: Handler 2, Default
// Run: Handler 2, Default
jQuery
(
"#liveSpan1"
).
trigger
(
"foo"
);
jQuery
(
"#liveSpan1"
).
trigger
(
"foo"
,
42
);
// Run: remove, teardown
// Run: remove, teardown
jQuery
(
"#liveSpan1"
).
die
(
"foo"
);
jQuery
(
"#liveSpan1"
).
die
(
"foo"
);
...
...
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