mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #752 from ZogStriP/add-autocomplete-support-for-plus-and-minus
Add '+' and '-' support to the autocomplete plugin
This commit is contained in:
commit
316f744ad7
1 changed files with 4 additions and 0 deletions
|
@ -294,6 +294,10 @@ $.fn.autocomplete = function(options) {
|
||||||
term = me.val().substring(completeStart + (options.key ? 1 : 0), caretPosition);
|
term = me.val().substring(completeStart + (options.key ? 1 : 0), caretPosition);
|
||||||
if (e.which >= 48 && e.which <= 90) {
|
if (e.which >= 48 && e.which <= 90) {
|
||||||
term += String.fromCharCode(e.which);
|
term += String.fromCharCode(e.which);
|
||||||
|
} else if (e.which === 187) {
|
||||||
|
term += "+";
|
||||||
|
} else if (e.which === 189) {
|
||||||
|
term += "-";
|
||||||
} else {
|
} else {
|
||||||
if (e.which !== 8) {
|
if (e.which !== 8) {
|
||||||
term += ",";
|
term += ",";
|
||||||
|
|
Loading…
Reference in a new issue