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
2f1ddd45
Commit
2f1ddd45
authored
Apr 11, 2012
by
Rick Waldron
Committed by
Dave Methvin
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #11500. Allow triggered, simulated change events.
parent
62a4c845
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
event.js
src/event.js
+2
-2
event.js
test/unit/event.js
+10
-0
No files found.
src/event.js
View file @
2f1ddd45
...
@@ -825,8 +825,9 @@ if ( !jQuery.support.changeBubbles ) {
...
@@ -825,8 +825,9 @@ if ( !jQuery.support.changeBubbles ) {
jQuery
.
event
.
add
(
this
,
"click._change"
,
function
(
event
)
{
jQuery
.
event
.
add
(
this
,
"click._change"
,
function
(
event
)
{
if
(
this
.
_just_changed
&&
!
event
.
isTrigger
)
{
if
(
this
.
_just_changed
&&
!
event
.
isTrigger
)
{
this
.
_just_changed
=
false
;
this
.
_just_changed
=
false
;
jQuery
.
event
.
simulate
(
"change"
,
this
,
event
,
true
);
}
}
// Allow triggered, simulated change events (#11500)
jQuery
.
event
.
simulate
(
"change"
,
this
,
event
,
true
);
});
});
}
}
return
false
;
return
false
;
...
@@ -1073,4 +1074,3 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
...
@@ -1073,4 +1074,3 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
});
});
})(
jQuery
);
})(
jQuery
);
test/unit/event.js
View file @
2f1ddd45
...
@@ -2867,4 +2867,14 @@ test("fixHooks extensions", function() {
...
@@ -2867,4 +2867,14 @@ test("fixHooks extensions", function() {
})();
})();
test
(
"trigger click on checkbox, fires change event"
,
function
()
{
expect
(
1
);
var
check
=
jQuery
(
"#check2"
);
check
.
on
(
"change"
,
function
()
{
// get it?
check
.
off
(
"change"
);
ok
(
true
,
"Change event fired as a result of triggered click"
);
}).
trigger
(
"click"
);
});
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