From cd76add2de94d4474dacffdbe793e8bf51b700d8 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 18 Jul 2013 12:40:23 -0400 Subject: [PATCH] search.js: Clean up local variables a bit (imported from commit 5094017271994a0aa50ec8cccc633360b46e90dc) --- zephyr/static/js/search.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/zephyr/static/js/search.js b/zephyr/static/js/search.js index dff9797f71..166f5ef553 100644 --- a/zephyr/static/js/search.js +++ b/zephyr/static/js/search.js @@ -161,27 +161,28 @@ exports.initialize = function () { $( "#search_query" ).typeahead({ source: function (query, process) { var result = []; + var suggestion; + var suggestions; // Add an entry for narrow by operators. var operators = narrow.parse(query); if (operators.length !== 0) { - var suggestion = get_suggestion_based_on_query(query, operators); + suggestion = get_suggestion_based_on_query(query, operators); result = [suggestion]; } else { return []; } - var stream_suggestions = get_stream_suggestions(query, 4); - result = result.concat(stream_suggestions); + suggestions = get_stream_suggestions(query, 4); + result = result.concat(suggestions); var people = page_params.people_list; - var person_suggestions; - person_suggestions = get_person_suggestions(people, query, 'Narrow to private messages with', 'pm-with', 4); - result = result.concat(person_suggestions); + suggestions = get_person_suggestions(people, query, 'Narrow to private messages with', 'pm-with', 4); + result = result.concat(suggestions); - person_suggestions = get_person_suggestions(people, query, 'Narrow to messages sent by', 'sender', 4); - result = result.concat(person_suggestions); + suggestions = get_person_suggestions(people, query, 'Narrow to messages sent by', 'sender', 4); + result = result.concat(suggestions); // We can't send typeahead objects, only strings. search_object = {};