Organize navigation events in hotkey.js

(imported from commit 2bff0eb8bf7f8f310a5823bc4a569a7b298608c9)
This commit is contained in:
Steve Howell 2013-07-24 17:45:19 -04:00
parent 432f9794cb
commit 6e0b6dfc24
2 changed files with 9 additions and 13 deletions

View File

@ -195,10 +195,6 @@ function process_hotkey(e) {
return false;
}
if (event_name === 'end') {
navigate.to_end();
return true;
}
switch (event_name) {
case 'message_actions':
@ -217,12 +213,6 @@ function process_hotkey(e) {
switch (event_name) {
case 'page_up':
navigate.page_up();
return true;
case 'page_down':
navigate.page_down();
return true;
case 'escape': // Esc: close actions popup, cancel compose, clear a find, or un-narrow
if (popovers.any_active()) {
popovers.hide_all();
@ -273,6 +263,15 @@ function process_hotkey(e) {
case 'home':
navigate.to_home();
return true;
case 'end':
navigate.to_end();
return true;
case 'page_up':
navigate.page_up();
return true;
case 'page_down':
navigate.page_down();
return true;
}
return false;

View File

@ -44,9 +44,6 @@ exports.to_home = function () {
};
exports.to_end = function () {
if (current_msg_list.empty()) {
return false;
}
var next_id = current_msg_list.last().id;
last_viewport_movement_direction = 1;
current_msg_list.select_id(next_id, {then_scroll: true,