hotkeys: Change subscribe stream hotkey to S.

This commit is contained in:
Cynthia Lin
2017-05-24 11:15:51 -07:00
committed by Tim Abbott
parent 6993f8900a
commit 2045426ab9
2 changed files with 15 additions and 12 deletions

View File

@@ -95,7 +95,6 @@ var keypress_mappings = {
80: {name: 'narrow_private', message_view_only: true}, // 'P'
82: {name: 'respond_to_author', message_view_only: true}, // 'R'
83: {name: 'narrow_by_subject', message_view_only: true}, //'S'
85: {name: 'keyboard_sub', message_view_only: false}, //'U'
86: {name: 'view_selected_stream', message_view_only: false}, //'V'
99: {name: 'compose', message_view_only: true}, // 'c'
100: {name: 'open_drafts', message_view_only: false}, // 'd'
@@ -417,6 +416,17 @@ exports.process_hotkey = function (e, hotkey) {
}
}
if (hotkey.message_view_only && modals.is_active()) {
if (exports.processing_text()) {
return false;
}
if (event_name === 'narrow_by_subject' && modals.streams_open()) {
subs.keyboard_sub();
return true;
}
return false;
}
if (modals.settings_open()) {
if (exports.processing_text()) {
return false;
@@ -440,10 +450,6 @@ exports.process_hotkey = function (e, hotkey) {
return false;
}
if (hotkey.message_view_only && modals.is_active()) {
return false;
}
if ((event_name === 'up_arrow' || event_name === 'down_arrow') && modals.streams_open()) {
return subs.switch_rows(event_name);
}
@@ -565,11 +571,6 @@ exports.process_hotkey = function (e, hotkey) {
case 'stream_cycle_forward':
navigate.cycle_stream('forward');
return true;
case 'keyboard_sub':
if (modals.streams_open()) {
subs.keyboard_sub();
}
return true;
case 'view_selected_stream':
if (modals.streams_open()) {
subs.view_stream();