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
3bcd04f5
Commit
3bcd04f5
authored
Sep 19, 2013
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13993. Save result of native inline handlers. Close gh-1368.
parent
43757500
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
event.js
src/event.js
+5
-2
event.js
test/unit/event.js
+8
-0
No files found.
src/event.js
View file @
3bcd04f5
...
@@ -312,8 +312,11 @@ jQuery.event = {
...
@@ -312,8 +312,11 @@ jQuery.event = {
// Native handler
// Native handler
handle
=
ontype
&&
cur
[
ontype
];
handle
=
ontype
&&
cur
[
ontype
];
if
(
handle
&&
jQuery
.
acceptData
(
cur
)
&&
handle
.
apply
&&
handle
.
apply
(
cur
,
data
)
===
false
)
{
if
(
handle
&&
handle
.
apply
&&
jQuery
.
acceptData
(
cur
)
)
{
event
.
preventDefault
();
event
.
result
=
handle
.
apply
(
cur
,
data
);
if
(
event
.
result
===
false
)
{
event
.
preventDefault
();
}
}
}
}
}
event
.
type
=
type
;
event
.
type
=
type
;
...
...
test/unit/event.js
View file @
3bcd04f5
...
@@ -2613,3 +2613,11 @@ test( "String.prototype.namespace does not cause trigger() to throw (#13360)", f
...
@@ -2613,3 +2613,11 @@ test( "String.prototype.namespace does not cause trigger() to throw (#13360)", f
equal
(
errored
,
false
,
"trigger() did not throw exception"
);
equal
(
errored
,
false
,
"trigger() did not throw exception"
);
delete
String
.
prototype
.
namespace
;
delete
String
.
prototype
.
namespace
;
});
});
test
(
"Inline event result is returned (#13993)"
,
function
()
{
expect
(
1
);
var
result
=
jQuery
(
"<p onclick='return 42'>hello</p>"
).
triggerHandler
(
"click"
);
equal
(
result
,
42
,
"inline handler returned value"
);
});
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