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
d46042e0
Commit
d46042e0
authored
Apr 17, 2011
by
Brian Brennan
Committed by
John Resig
Apr 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix live mouseenter and mouseleave binding so they can be activated by triggers. Fixes #6514.
parent
21c0be84
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
event.js
src/event.js
+1
-1
event.js
test/unit/event.js
+19
-2
No files found.
src/event.js
View file @
d46042e0
...
@@ -1066,7 +1066,7 @@ jQuery.each(["live", "die"], function( i, name ) {
...
@@ -1066,7 +1066,7 @@ jQuery.each(["live", "die"], function( i, name ) {
preType
=
type
;
preType
=
type
;
if
(
type
===
"focus"
||
type
===
"blur"
)
{
if
(
type
===
"focus"
||
type
===
"blur"
||
type
===
"mouseenter"
||
type
===
"mouseleave"
)
{
types
.
push
(
liveMap
[
type
]
+
namespaces
);
types
.
push
(
liveMap
[
type
]
+
namespaces
);
type
=
type
+
namespaces
;
type
=
type
+
namespaces
;
...
...
test/unit/event.js
View file @
d46042e0
...
@@ -832,7 +832,7 @@ test("trigger() bubbling", function() {
...
@@ -832,7 +832,7 @@ test("trigger() bubbling", function() {
});
});
test
(
"trigger(type, [data], [fn])"
,
function
()
{
test
(
"trigger(type, [data], [fn])"
,
function
()
{
expect
(
1
4
);
expect
(
1
6
);
var
handler
=
function
(
event
,
a
,
b
,
c
)
{
var
handler
=
function
(
event
,
a
,
b
,
c
)
{
equals
(
event
.
type
,
"click"
,
"check passed data"
);
equals
(
event
.
type
,
"click"
,
"check passed data"
);
...
@@ -849,6 +849,23 @@ test("trigger(type, [data], [fn])", function() {
...
@@ -849,6 +849,23 @@ test("trigger(type, [data], [fn])", function() {
ok
(
true
,
"Native call was triggered"
);
ok
(
true
,
"Native call was triggered"
);
};
};
$elem
.
live
(
'mouseenter'
,
function
(){
ok
(
true
,
'Trigger mouseenter bound by live'
);
});
$elem
.
live
(
'mouseleave'
,
function
(){
ok
(
true
,
'Trigger mouseleave bound by live'
);
});
$elem
.
trigger
(
'mouseenter'
);
$elem
.
trigger
(
'mouseleave'
);
$elem
.
die
(
'mouseenter'
);
$elem
.
die
(
'mouseleave'
);
// Triggers handlrs and native
// Triggers handlrs and native
// Trigger 5
// Trigger 5
$elem
.
bind
(
"click"
,
handler
).
trigger
(
"click"
,
[
1
,
"2"
,
"abc"
]);
$elem
.
bind
(
"click"
,
handler
).
trigger
(
"click"
,
[
1
,
"2"
,
"abc"
]);
...
...
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