Do not send the browser back on backspace when send button focused

Fixes Trac #585

(imported from commit 2b5a02db66cc09ae41da7e6921a31a14c49cf811)
This commit is contained in:
Jeff Arnold 2013-01-08 11:25:17 -05:00
parent e5ab18276e
commit 78506acd20
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,13 @@ function process_hotkey(e) {
if (ui.home_tab_obscured())
return false;
// In browsers where backspace sends the browser back (e.g. Mac Chrome),
// do not go back if the send button is in focus
if ($('#compose-send-button:focus').length > 0 && code === 8) {
e.preventDefault();
return false;
}
// Process hotkeys specially when in an input, textarea, or send button
if ($('input:focus,textarea:focus,#compose-send-button:focus').length > 0) {
if (code === 27) {