mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Add maybe_show_keyboard_shortcuts().
This prevents some strange UI experiences and some blueslip errors by not opening keyboard help when other overlays or popovers are open.
This commit is contained in:
@@ -200,7 +200,7 @@ function stubbing(func_name_to_stub, test_function) {
|
||||
assert_mapping('n', 'subs.new_stream_clicked');
|
||||
overlays.streams_open = return_false;
|
||||
|
||||
assert_mapping('?', 'ui.show_info_overlay');
|
||||
assert_mapping('?', 'ui.maybe_show_keyboard_shortcuts');
|
||||
assert_mapping('/', 'search.initiate_search');
|
||||
assert_mapping('q', 'activity.initiate_search');
|
||||
assert_mapping('w', 'stream_list.initiate_search');
|
||||
|
||||
@@ -564,7 +564,7 @@ exports.process_hotkey = function (e, hotkey) {
|
||||
gear_menu.open();
|
||||
return true;
|
||||
case 'show_shortcuts': // Show keyboard shortcuts page
|
||||
ui.show_info_overlay("keyboard-shortcuts");
|
||||
ui.maybe_show_keyboard_shortcuts();
|
||||
return true;
|
||||
case 'stream_cycle_backward':
|
||||
navigate.cycle_stream('backward');
|
||||
|
||||
@@ -156,6 +156,16 @@ exports.show_info_overlay = function (target) {
|
||||
}
|
||||
};
|
||||
|
||||
exports.maybe_show_keyboard_shortcuts = function () {
|
||||
if (overlays.is_active()) {
|
||||
return;
|
||||
}
|
||||
if (popovers.any_active()) {
|
||||
return;
|
||||
}
|
||||
ui.show_info_overlay("keyboard-shortcuts");
|
||||
};
|
||||
|
||||
var loading_more_messages_indicator_showing = false;
|
||||
exports.show_loading_more_messages_indicator = function () {
|
||||
if (! loading_more_messages_indicator_showing) {
|
||||
|
||||
Reference in New Issue
Block a user