hotkeys: Rename subs.arrow_keys() to subs.switch_rows().

This commit is contained in:
Cynthia Lin 2017-03-22 14:18:34 -07:00 committed by Tim Abbott
parent 42265fe035
commit d17131dcb4
3 changed files with 4 additions and 4 deletions

View File

@ -293,8 +293,8 @@ function stubbing(func_name_to_stub, test_function) {
hotkey.is_subs = return_true;
global.ui_state.home_tab_obscured = return_true;
assert_mapping('up_arrow', 'subs.arrow_keys');
assert_mapping('down_arrow', 'subs.arrow_keys');
assert_mapping('up_arrow', 'subs.switch_rows');
assert_mapping('down_arrow', 'subs.switch_rows');
global.ui_state.home_tab_obscured = return_false;
hotkey.is_settings_page = return_true;

View File

@ -435,7 +435,7 @@ exports.process_hotkey = function (e, hotkey) {
if (hotkey.message_view_only && ui_state.home_tab_obscured()) {
// if up/down arrow key was pressed and streams menu is open
if ((event_name === 'up_arrow' || event_name === 'down_arrow') && exports.is_subs()) {
subs.arrow_keys(event_name);
subs.switch_rows(event_name);
return true;
}
return false;

View File

@ -707,7 +707,7 @@ exports.close = function () {
subs.remove_miscategorized_streams();
};
exports.arrow_keys = function (event) {
exports.switch_rows = function (event) {
var active_row = $('div.stream-row.active'); // current active row
var switch_row; // initialize var for row that we're switching to
// if rows have undefined attributes (no selected/active row)