mirror of https://github.com/zulip/zulip.git
Organize navigation events in hotkey.js
(imported from commit 2bff0eb8bf7f8f310a5823bc4a569a7b298608c9)
This commit is contained in:
parent
432f9794cb
commit
6e0b6dfc24
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue