git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9190d4f
)
Tweak the logic for fixing event.which. Fixes #2338.
author
John Resig
<jeresig@gmail.com>
Tue, 28 Sep 2010 16:07:57 +0000
(09:07 -0700)
committer
John Resig
<jeresig@gmail.com>
Tue, 28 Sep 2010 16:07:57 +0000
(09:07 -0700)
src/event.js
patch
|
blob
|
history
diff --git
a/src/event.js
b/src/event.js
index
65b5952
..
00bef84
100644
(file)
--- a/
src/event.js
+++ b/
src/event.js
@@
-470,8
+470,8
@@
jQuery.event = {
}
// Add which for key events
}
// Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
- event.which = event.charCode || event.keyCode;
+ if ( event.which == null && (event.charCode != null || event.charCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)