Side navigation
Ticket #2338: jquery-4750-which.diff
File jquery-4750-which.diff, 0.7 KB (added by DarkRyder, February 13, 2008 07:26PM UTC)
Index: event.js
===================================================================
--- event.js (revision 4750)
+++ event.js (working copy)
@@ -321,8 +321,8 @@
}
// Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
- event.which = event.charCode || event.keyCode;
+ if ( typeof event.which == "undefined" && (typeof event.charCode != "undefined" || typeof event.keyCode != "undefined") )
+ event.which = typeof event.charCode != "undefined" ? event.charCode : event.keyCode;
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey )
Download in other formats:
Original Format
File jquery-4750-which.diff, 0.7 KB (added by DarkRyder, February 13, 2008 07:26PM UTC)
Index: event.js
===================================================================
--- event.js (revision 4750)
+++ event.js (working copy)
@@ -321,8 +321,8 @@
}
// Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
- event.which = event.charCode || event.keyCode;
+ if ( typeof event.which == "undefined" && (typeof event.charCode != "undefined" || typeof event.keyCode != "undefined") )
+ event.which = typeof event.charCode != "undefined" ? event.charCode : event.keyCode;
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey )