ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Get trigger char when using multiple triggers #78

Open Patchesoft opened 6 years ago

Patchesoft commented 6 years ago

I am doing something like this:

$(".editor-textarea").mentionsInput({trigger: "#@", source: global_base_url + 'home/get_user_friends'});

I want to be able to distinguish when the users # or @ so I can lookup the correct database table of terms and return them as such. The only data currently being sent is term

Anyone got a solution for this?

Patchesoft commented 6 years ago

I managed to solve this issue by keeping the trigger character next to the value in the hidden input. So instead of username it would appear @username.

I changed the following line (160):

this.searchTerm = match[1];