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
da26d0eb
Commit
da26d0eb
authored
Mar 09, 2010
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote the live/delegate submit tests to be more generic.
parent
f68b46d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
20 deletions
+6
-20
event.js
test/unit/event.js
+6
-20
No files found.
test/unit/event.js
View file @
da26d0eb
...
...
@@ -1297,16 +1297,9 @@ test("live with submit", function() {
ev
.
preventDefault
();
});
if
(
jQuery
.
support
.
submitBubbles
)
{
jQuery
(
"#testForm input[name=sub1]"
)[
0
].
click
();
equals
(
count1
,
1
);
equals
(
count2
,
1
);
}
else
{
jQuery
(
"#testForm input[name=sub1]"
)[
0
].
click
();
jQuery
(
"#testForm input[name=T1]"
).
trigger
({
type
:
"keypress"
,
keyCode
:
13
});
equals
(
count1
,
2
);
equals
(
count2
,
2
);
}
jQuery
(
"#testForm input[name=sub1]"
).
submit
();
equals
(
count1
,
1
,
"Verify form submit."
);
equals
(
count2
,
1
,
"Verify body submit."
);
jQuery
(
"#testForm"
).
die
(
"submit"
);
jQuery
(
"body"
).
die
(
"submit"
);
...
...
@@ -1773,16 +1766,9 @@ test("delegate with submit", function() {
ev
.
preventDefault
();
});
if
(
jQuery
.
support
.
submitBubbles
)
{
jQuery
(
"#testForm input[name=sub1]"
)[
0
].
click
();
equals
(
count1
,
1
);
equals
(
count2
,
1
);
}
else
{
jQuery
(
"#testForm input[name=sub1]"
)[
0
].
click
();
jQuery
(
"#testForm input[name=T1]"
).
trigger
({
type
:
"keypress"
,
keyCode
:
13
});
equals
(
count1
,
2
);
equals
(
count2
,
2
);
}
jQuery
(
"#testForm input[name=sub1]"
).
submit
();
equals
(
count1
,
1
,
"Verify form submit."
);
equals
(
count2
,
1
,
"Verify body submit."
);
jQuery
(
"#body"
).
undelegate
();
jQuery
(
document
).
undelegate
();
...
...
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