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
0b9a182e
Commit
0b9a182e
authored
Sep 23, 2013
by
Oleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run focus test only if document has focus
parent
3d6ed448
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
event.js
test/unit/event.js
+21
-21
No files found.
test/unit/event.js
View file @
0b9a182e
...
@@ -2640,35 +2640,35 @@ test( "make sure events cloned correctly", 18, function() {
...
@@ -2640,35 +2640,35 @@ test( "make sure events cloned correctly", 18, function() {
clone
.
find
(
"#check1"
).
trigger
(
"change"
);
// 0 events should fire
clone
.
find
(
"#check1"
).
trigger
(
"change"
);
// 0 events should fire
});
});
asyncTest
(
"Check order of focusin/focusout events"
,
2
,
function
()
{
// This test fails in some browsers if document does not have focus
if
(
!
document
.
hasFocus
||
document
.
hasFocus
&&
document
.
hasFocus
()
)
{
test
(
"Check order of focusin/focusout events"
,
2
,
function
()
{
var
focus
,
blur
,
var
focus
,
blur
,
input
=
jQuery
(
"#name"
);
input
=
jQuery
(
"#name"
);
input
.
on
(
"focus"
,
function
()
{
input
.
on
(
"focus"
,
function
()
{
focus
=
true
;
focus
=
true
;
}).
on
(
"focusin"
,
function
()
{
}).
on
(
"focusin"
,
function
()
{
ok
(
!
focus
,
"Focusin event should fire before focus does"
);
ok
(
!
focus
,
"Focusin event should fire before focus does"
);
}).
on
(
"blur"
,
function
()
{
}).
on
(
"blur"
,
function
()
{
blur
=
true
;
blur
=
true
;
}).
on
(
"focusout"
,
function
()
{
}).
on
(
"focusout"
,
function
()
{
ok
(
!
blur
,
"Focusout event should fire before blur does"
);
ok
(
!
blur
,
"Focusout event should fire before blur does"
);
});
});
// gain focus
// gain focus
input
.
trigger
(
"focus"
);
input
.
trigger
(
"focus"
);
// then lose it
// then lose it
jQuery
(
"#search"
).
trigger
(
"focus"
);
jQuery
(
"#search"
).
trigger
(
"focus"
);
// cleanup
// cleanup
setTimeout
(
function
()
{
input
.
off
();
input
.
off
();
start
();
});
},
50
);
}
});
test
(
"String.prototype.namespace does not cause trigger() to throw (#13360)"
,
function
()
{
test
(
"String.prototype.namespace does not cause trigger() to throw (#13360)"
,
function
()
{
expect
(
1
);
expect
(
1
);
...
...
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