From ea23f637e141299047065c46f8e155fc661983e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 22 Apr 2013 01:43:41 +0200 Subject: [PATCH] Add '+' and '-' support to the autocomplete plugin --- app/assets/javascripts/discourse/components/autocomplete.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/components/autocomplete.js b/app/assets/javascripts/discourse/components/autocomplete.js index 3cfca2b9e..3be4ff537 100644 --- a/app/assets/javascripts/discourse/components/autocomplete.js +++ b/app/assets/javascripts/discourse/components/autocomplete.js @@ -294,6 +294,10 @@ $.fn.autocomplete = function(options) { term = me.val().substring(completeStart + (options.key ? 1 : 0), caretPosition); if (e.which >= 48 && e.which <= 90) { term += String.fromCharCode(e.which); + } else if (e.which === 187) { + term += "+"; + } else if (e.which === 189) { + term += "-"; } else { if (e.which !== 8) { term += ",";