aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-28 09:07:57 -0700
committerJohn Resig <jeresig@gmail.com>2010-09-28 09:07:57 -0700
commite3c4e5789743eecb3cbe2b626f3a5f09c616ee4b (patch)
tree8bf874d001d1b05354011f87ea1c8e1c03fd3547 /src/event.js
parent9190d4fd603884ed1debf8c0f7817d45b72e1aef (diff)
downloadjquery-e3c4e5789743eecb3cbe2b626f3a5f09c616ee4b.tar.gz
jquery-e3c4e5789743eecb3cbe2b626f3a5f09c616ee4b.zip
Tweak the logic for fixing event.which. Fixes #2338.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js
index 65b59523e..00bef8472 100644
--- a/src/event.js
+++ b/src/event.js
@@ -470,8 +470,8 @@ jQuery.event = {
}
// 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)