From cd60f18752596220372528f52dada55d1fd7a27f Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 10 Jan 2013 13:57:34 -0500 Subject: [PATCH] Add typeahead to 'add subscriber' input box (imported from commit 49e9a75d3153e1ac97e924a1bdc971df46d6bc10) --- zephyr/static/js/subs.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index a34de4b343..3568db44fb 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -360,6 +360,18 @@ $(function () { error_elem.removeClass("hide").text("Could not fetch subscriber list"); } }); + + sub_row.find('input[name="principal"]').typeahead({ + source: typeahead_helper.private_message_typeahead_list, + items: 4, + highlighter: function (item) { + var query = this.query; + return typeahead_helper.highlight_with_escaping(query, item); + }, + updater: function (item) { + return typeahead_helper.private_message_mapped[item].email; + } + }); }); });