mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
Revert "Tweak hotkey behavior when pointer isn't shown."
This reverts commit 74fb298c711e61ae98c210d0ed11c875ce6ba591. We've decided this experiment didn't work out. (imported from commit 8acd3a030b692f9397155a20a9f89e63ed6a6cf7)
This commit is contained in:
@@ -204,10 +204,18 @@ function process_hotkey(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (event_name) {
|
switch (event_name) {
|
||||||
|
case 'narrow_by_recipient':
|
||||||
|
return do_narrow_action(narrow.by_recipient);
|
||||||
|
case 'narrow_by_subject':
|
||||||
|
return do_narrow_action(narrow.by_subject);
|
||||||
case 'narrow_private':
|
case 'narrow_private':
|
||||||
return do_narrow_action(function (target, opts) {
|
return do_narrow_action(function (target, opts) {
|
||||||
narrow.by('is', 'private-message', opts);
|
narrow.by('is', 'private-message', opts);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch (event_name) {
|
||||||
case 'page_up':
|
case 'page_up':
|
||||||
if (viewport.at_top() && !current_msg_list.empty()) {
|
if (viewport.at_top() && !current_msg_list.empty()) {
|
||||||
current_msg_list.select_id(current_msg_list.first().id, {then_scroll: false});
|
current_msg_list.select_id(current_msg_list.first().id, {then_scroll: false});
|
||||||
@@ -241,6 +249,17 @@ function process_hotkey(e) {
|
|||||||
compose.set_mode('private');
|
compose.set_mode('private');
|
||||||
respond_to_sent_message = true;
|
respond_to_sent_message = true;
|
||||||
return true;
|
return true;
|
||||||
|
case 'enter': // Enter: respond to message (unless we need to do something else)
|
||||||
|
respond_to_cursor = true;
|
||||||
|
respond_to_message({trigger: 'hotkey enter'});
|
||||||
|
return true;
|
||||||
|
case 'reply_message': // 'r': respond to message
|
||||||
|
respond_to_cursor = true;
|
||||||
|
respond_to_message({trigger: 'hotkey'});
|
||||||
|
return true;
|
||||||
|
case 'respond_to_author': // 'R': respond to author
|
||||||
|
respond_to_message({reply_type: "personal", trigger: 'hotkey pm'});
|
||||||
|
return true;
|
||||||
case 'search':
|
case 'search':
|
||||||
search.initiate_search();
|
search.initiate_search();
|
||||||
return true;
|
return true;
|
||||||
@@ -249,36 +268,6 @@ function process_hotkey(e) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ui.pointer_visible()) {
|
|
||||||
// These actions act on the message under the pointer and don't make
|
|
||||||
// sense when the pointer is hidden.
|
|
||||||
switch (event_name) {
|
|
||||||
case 'narrow_by_recipient':
|
|
||||||
return do_narrow_action(narrow.by_recipient);
|
|
||||||
case 'narrow_by_subject':
|
|
||||||
return do_narrow_action(narrow.by_subject);
|
|
||||||
case 'enter': // Enter: respond to message (unless we need to do something else)
|
|
||||||
respond_to_cursor = true;
|
|
||||||
respond_to_message({trigger: 'hotkey enter'});
|
|
||||||
return true;
|
|
||||||
case 'reply_message': // 'r': respond to message
|
|
||||||
respond_to_cursor = true;
|
|
||||||
respond_to_message({trigger: 'hotkey'});
|
|
||||||
return true;
|
|
||||||
case 'respond_to_author': // 'R': respond to author
|
|
||||||
respond_to_message({reply_type: "personal", trigger: 'hotkey pm'});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Behavior when cursor is hidden
|
|
||||||
switch (event_name) {
|
|
||||||
case 'enter':
|
|
||||||
ui.show_pointer(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -733,17 +733,8 @@ exports.stream_sidebar_currently_popped = function () {
|
|||||||
return current_stream_sidebar_elem !== undefined;
|
return current_stream_sidebar_elem !== undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.show_pointer = function (apply_now) {
|
exports.show_pointer = function () {
|
||||||
pointer_visible = true;
|
pointer_visible = true;
|
||||||
if (apply_now) {
|
|
||||||
// Needs a selection change to actually apply the class. Otherwise the
|
|
||||||
// next selection change makes the cursor visible.
|
|
||||||
current_msg_list.select_id(current_msg_list.selected_id());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.pointer_visible = function () {
|
|
||||||
return pointer_visible;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user