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
66e9a6f7
Commit
66e9a6f7
authored
Aug 17, 2011
by
Dave Methvin
Committed by
timmywil
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a `blur` event bubble properly when mutated into a `focusout` event.
parent
8a6bbc70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
event.js
src/event.js
+10
-7
No files found.
src/event.js
View file @
66e9a6f7
...
@@ -96,8 +96,13 @@ jQuery.event = {
...
@@ -96,8 +96,13 @@ jQuery.event = {
tns
=
rtypenamespace
.
exec
(
types
[
t
]
)
||
[];
tns
=
rtypenamespace
.
exec
(
types
[
t
]
)
||
[];
type
=
tns
[
1
];
type
=
tns
[
1
];
namespaces
=
(
tns
[
2
]
||
""
).
split
(
"."
).
sort
();
namespaces
=
(
tns
[
2
]
||
""
).
split
(
"."
).
sort
();
// If event changes its type, use the special event handlers for the changed type
special
=
jQuery
.
event
.
special
[
type
]
||
{};
special
=
jQuery
.
event
.
special
[
type
]
||
{};
type
=
(
selector
?
special
.
delegateType
:
special
.
bindType
)
||
type
;
type
=
(
selector
?
special
.
delegateType
:
special
.
bindType
)
||
type
;
special
=
jQuery
.
event
.
special
[
type
]
||
{};
// handleObj is passed to all event handlers
handleObj
=
jQuery
.
extend
({
handleObj
=
jQuery
.
extend
({
type
:
type
,
type
:
type
,
origType
:
tns
[
1
],
origType
:
tns
[
1
],
...
@@ -108,9 +113,8 @@ jQuery.event = {
...
@@ -108,9 +113,8 @@ jQuery.event = {
namespace
:
namespaces
.
join
(
"."
)
namespace
:
namespaces
.
join
(
"."
)
},
handleObjIn
);
},
handleObjIn
);
// Delegated event
setup
// Delegated event
; pre-analyze selector so it's processed quickly on event dispatch
if
(
selector
)
{
if
(
selector
)
{
// Pre-analyze selector so we can process it quickly on event dispatch
handleObj
.
quick
=
quickParse
(
selector
);
handleObj
.
quick
=
quickParse
(
selector
);
if
(
!
handleObj
.
quick
&&
jQuery
.
expr
.
match
.
POS
.
test
(
selector
)
)
{
if
(
!
handleObj
.
quick
&&
jQuery
.
expr
.
match
.
POS
.
test
(
selector
)
)
{
handleObj
.
isPositional
=
true
;
handleObj
.
isPositional
=
true
;
...
@@ -890,7 +894,10 @@ if ( !jQuery.support.focusinBubbles ) {
...
@@ -890,7 +894,10 @@ if ( !jQuery.support.focusinBubbles ) {
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
// Attach a single capturing handler while someone wants focusin/focusout
// Attach a single capturing handler while someone wants focusin/focusout
var
attaches
=
0
;
var
attaches
=
0
,
handler
=
function
(
event
)
{
simulate
(
fix
,
event
.
target
,
jQuery
.
event
.
fix
(
event
),
true
);
};
jQuery
.
event
.
special
[
fix
]
=
{
jQuery
.
event
.
special
[
fix
]
=
{
setup
:
function
()
{
setup
:
function
()
{
...
@@ -904,10 +911,6 @@ if ( !jQuery.support.focusinBubbles ) {
...
@@ -904,10 +911,6 @@ if ( !jQuery.support.focusinBubbles ) {
}
}
}
}
};
};
function
handler
(
event
)
{
simulate
(
fix
,
event
.
target
,
jQuery
.
event
.
fix
(
event
),
true
);
}
});
});
}
}
...
...
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