mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 04:23:01 +08:00
Add '+' and '-' support to the autocomplete plugin
This commit is contained in:
parent
c14679995d
commit
ea23f637e1
|
@ -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 New Issue
Block a user