From ce4a850bfcb766a1cde27517f5da2228269c12e7 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 18 Sep 2013 15:40:57 -0400 Subject: [PATCH] Remove all user we insert into autocomplete when alerting (imported from commit 34521b5e9e312b5026f9dc015cc35de837d0e2a3) --- static/js/composebox_typeahead.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js index baced81d1d..38b36bd877 100644 --- a/static/js/composebox_typeahead.js +++ b/static/js/composebox_typeahead.js @@ -373,7 +373,11 @@ exports.initialize = function () { beginning = (beginning.substring(0, beginning.length - this.token.length-1) + '@**' + item.full_name + '** '); - $(document).trigger('usermention_completed.zulip', {mentioned: item}); + // We insert a special `all` item to the autocompleter above + // Don't consider it a user mention + if (item.email !== 'all') { + $(document).trigger('usermention_completed.zulip', {mentioned: item}); + } } // Keep the cursor after the newly inserted text, as Bootstrap will call textbox.change() to overwrite the text