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:
Tim Abbott
2013-06-19 11:10:42 -04:00
parent e55eb53297
commit c87e12ad41
2 changed files with 20 additions and 40 deletions

View File

@@ -204,10 +204,18 @@ function process_hotkey(e) {
}
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':
return do_narrow_action(function (target, opts) {
narrow.by('is', 'private-message', opts);
});
}
switch (event_name) {
case 'page_up':
if (viewport.at_top() && !current_msg_list.empty()) {
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');
respond_to_sent_message = 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':
search.initiate_search();
return true;
@@ -249,36 +268,6 @@ function process_hotkey(e) {
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;
}

View File

@@ -733,17 +733,8 @@ exports.stream_sidebar_currently_popped = function () {
return current_stream_sidebar_elem !== undefined;
};
exports.show_pointer = function (apply_now) {
exports.show_pointer = function () {
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 () {