mirror of https://github.com/zulip/zulip.git
Fix tab not toggling the compose window in Firefox.
(imported from commit 4dfd3d6eb3e81c519d0aefbfe0b3b1390adb241b)
This commit is contained in:
parent
db3c40fad1
commit
4062550ef7
|
@ -170,10 +170,15 @@ $(document).keydown(function (event) {
|
|||
$(document).keypress(function (event) {
|
||||
// What exactly triggers .keypress may vary by browser.
|
||||
// Welcome to compatability hell.
|
||||
|
||||
var result = keydown_handler(event.which);
|
||||
if (typeof result === 'function') {
|
||||
keydown_handler = result;
|
||||
event.preventDefault();
|
||||
//
|
||||
// In particular, when you press tab in Firefox, it fires a
|
||||
// keypress event with keycode 0 after processing the original
|
||||
// event.
|
||||
if (event.which !== 0 && event.charCode !== 0) {
|
||||
var result = keydown_handler(event.which);
|
||||
if (typeof result === 'function') {
|
||||
keydown_handler = result;
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue