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
89b771da
Commit
89b771da
authored
Nov 21, 2010
by
Anton M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure custom events named "submit" can be bound to non DOM elements in IE too. Fixes 6398.
parent
0838bdf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
event.js
src/event.js
+1
-1
event.js
test/unit/event.js
+10
-3
No files found.
src/event.js
View file @
89b771da
...
@@ -716,7 +716,7 @@ if ( !jQuery.support.submitBubbles ) {
...
@@ -716,7 +716,7 @@ if ( !jQuery.support.submitBubbles ) {
jQuery
.
event
.
special
.
submit
=
{
jQuery
.
event
.
special
.
submit
=
{
setup
:
function
(
data
,
namespaces
)
{
setup
:
function
(
data
,
namespaces
)
{
if
(
this
.
nodeName
.
toLowerCase
()
!==
"form"
)
{
if
(
this
.
nodeName
&&
this
.
nodeName
.
toLowerCase
()
!==
"form"
)
{
jQuery
.
event
.
add
(
this
,
"click.specialSubmit"
,
function
(
e
)
{
jQuery
.
event
.
add
(
this
,
"click.specialSubmit"
,
function
(
e
)
{
var
elem
=
e
.
target
,
var
elem
=
e
.
target
,
type
=
elem
.
type
;
type
=
elem
.
type
;
...
...
test/unit/event.js
View file @
89b771da
...
@@ -493,7 +493,7 @@ test("bind(name, false), unbind(name, false)", function() {
...
@@ -493,7 +493,7 @@ test("bind(name, false), unbind(name, false)", function() {
});
});
test
(
"bind()/trigger()/unbind() on plain object"
,
function
()
{
test
(
"bind()/trigger()/unbind() on plain object"
,
function
()
{
expect
(
7
);
expect
(
8
);
var
obj
=
{};
var
obj
=
{};
...
@@ -503,8 +503,13 @@ test("bind()/trigger()/unbind() on plain object", function() {
...
@@ -503,8 +503,13 @@ test("bind()/trigger()/unbind() on plain object", function() {
// Make sure it doesn't complain when no events are found
// Make sure it doesn't complain when no events are found
jQuery
(
obj
).
unbind
(
"test"
);
jQuery
(
obj
).
unbind
(
"test"
);
jQuery
(
obj
).
bind
(
"test"
,
function
(){
jQuery
(
obj
).
bind
({
ok
(
true
,
"Custom event run."
);
test
:
function
()
{
ok
(
true
,
"Custom event run."
);
},
submit
:
function
()
{
ok
(
true
,
"Custom submit event run."
);
}
});
});
var
events
=
jQuery
(
obj
).
data
(
"__events__"
);
var
events
=
jQuery
(
obj
).
data
(
"__events__"
);
...
@@ -516,8 +521,10 @@ test("bind()/trigger()/unbind() on plain object", function() {
...
@@ -516,8 +521,10 @@ test("bind()/trigger()/unbind() on plain object", function() {
// Should trigger 1
// Should trigger 1
jQuery
(
obj
).
trigger
(
"test"
);
jQuery
(
obj
).
trigger
(
"test"
);
jQuery
(
obj
).
trigger
(
"submit"
);
jQuery
(
obj
).
unbind
(
"test"
);
jQuery
(
obj
).
unbind
(
"test"
);
jQuery
(
obj
).
unbind
(
"submit"
);
// Should trigger 0
// Should trigger 0
jQuery
(
obj
).
trigger
(
"test"
);
jQuery
(
obj
).
trigger
(
"test"
);
...
...
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