Highlight search typeaheads for streams

(imported from commit e8725fe8c4f4985d46e48fdab5003e3e9def9bd1)
This commit is contained in:
Steve Howell 2013-05-07 10:04:59 -04:00 committed by Tim Abbott
parent 667a47755e
commit 96100bb42a
1 changed files with 8 additions and 0 deletions

View File

@ -220,6 +220,7 @@ exports.initialize = function () {
var prefix;
var person;
var name;
var stream;
if (obj.action === 'private_message') {
prefix = 'Narrow to private messages with';
@ -235,6 +236,13 @@ exports.initialize = function () {
return prefix + ' ' + name;
}
if (obj.action === 'stream') {
prefix = 'Narrow to stream';
stream = obj.query;
stream = typeahead_helper.highlight_query_in_phrase(query, stream);
return prefix + ' ' + stream;
}
var parts = render_object_in_parts(obj);
parts.query = Handlebars.Utils.escapeExpression(parts.query);
return parts.prefix + " " + parts.query + " " + parts.suffix;