From bb46bc099b65c71e60726029369f7a43bc1fbbf1 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Thu, 25 Jul 2019 12:46:02 +0530 Subject: [PATCH] typeahead: Show header text for some mentions. Show help text when completing stream, topic, mention and silent_mention. --- static/js/composebox_typeahead.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js index 8068bc9aee..84c74faaab 100644 --- a/static/js/composebox_typeahead.js +++ b/static/js/composebox_typeahead.js @@ -754,6 +754,19 @@ exports.compose_trigger_selection = function (event) { return false; }; +function get_header_text() { + var tip_text = ''; + switch (this.completing) { + case 'stream': + case 'topic_list': + tip_text = i18n.t('Press > to mention a topic'); + break; + default: + return false; + } + return '' + tip_text + ''; +} + exports.initialize_compose_typeahead = function (selector) { var completions = { mention: true, @@ -778,6 +791,7 @@ exports.initialize_compose_typeahead = function (selector) { completions: completions, automated: exports.compose_automated_selection, trigger_selection: exports.compose_trigger_selection, + header: get_header_text, }); };