From 8801158dfd0335cc241fc2b31291a8895a773c86 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Wed, 8 Mar 2017 14:05:32 -0800 Subject: [PATCH] Add hotkey actions for page up/down in compose box. The hotkey actions make the caret position go to the top of the compose box or bottom respectively, while the compose box is open. Fixes #1910. --- static/js/hotkey.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 14861e017d..491b0977c0 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -323,6 +323,13 @@ function process_hotkey(e) { if ((event_name === 'up_arrow' || event_name === 'down_arrow') && focus_in_empty_compose()) { compose.cancel(); // don't return, as we still want it to be picked up by the code below + } else if (event_name === "page_up") { + $("#new_message_content").caret(0); + return true; + } else if (event_name === "page_down") { + // so that it always goes to the end of the compose box. + $("#new_message_content").caret(Infinity); + return true; } else { // Let the browser handle the key normally. return false;