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
32b1cb3a
Commit
32b1cb3a
authored
Apr 22, 2008
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jquery.event: Patch for #2708
parent
6d28ebff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
event.js
src/event.js
+3
-0
event.js
test/unit/event.js
+9
-1
No files found.
src/event.js
View file @
32b1cb3a
...
@@ -293,6 +293,9 @@ jQuery.event = {
...
@@ -293,6 +293,9 @@ jQuery.event = {
originalEvent
.
cancelBubble
=
true
;
originalEvent
.
cancelBubble
=
true
;
};
};
// Fix timeStamp
event
.
timeStamp
=
event
.
timeStamp
||
+
new
Date
;
// Fix target property, if necessary
// Fix target property, if necessary
if
(
!
event
.
target
)
if
(
!
event
.
target
)
event
.
target
=
event
.
srcElement
||
document
;
// Fixes #1925 where srcElement might not be defined either
event
.
target
=
event
.
srcElement
||
document
;
// Fixes #1925 where srcElement might not be defined either
...
...
test/unit/event.js
View file @
32b1cb3a
...
@@ -165,7 +165,7 @@ test("unbind(event)", function() {
...
@@ -165,7 +165,7 @@ test("unbind(event)", function() {
ok
(
!
jQuery
.
data
(
el
[
0
],
"events"
),
"Removed the events expando after all handlers are unbound."
);
ok
(
!
jQuery
.
data
(
el
[
0
],
"events"
),
"Removed the events expando after all handlers are unbound."
);
reset
();
reset
();
var
clickCounter
=
mouseoverCounter
=
0
;
var
clickCounter
=
(
mouseoverCounter
=
0
)
;
var
handler
=
function
(
event
)
{
var
handler
=
function
(
event
)
{
if
(
event
.
type
==
"click"
)
if
(
event
.
type
==
"click"
)
clickCounter
+=
1
;
clickCounter
+=
1
;
...
@@ -304,3 +304,11 @@ test("jQuery(function($) {})", function() {
...
@@ -304,3 +304,11 @@ test("jQuery(function($) {})", function() {
start
();
start
();
});
});
});
});
test
(
"event properties"
,
function
()
{
stop
();
$
(
"#simon1"
).
click
(
function
(
event
)
{
ok
(
event
.
timeStamp
,
"assert event.timeStamp is present"
);
start
();
}).
click
();
});
\ No newline at end of file
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