Skip to content

Commit

Permalink
DOC-2579: Update the example using mentions_fetch to reflect demo cha…
Browse files Browse the repository at this point in the history
…nges.
  • Loading branch information
kemister85 committed Nov 19, 2024
1 parent 4ee1ed8 commit a859092
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions modules/ROOT/partials/configuration/mentions_fetch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ tinymce.init({
usersRequest = fetch('/users');
}
usersRequest.then((users) => {
// query.term is the text the user typed after the '@'
users = users.filter((user) => {
return user.name.indexOf(query.term.toLowerCase()) !== -1;
});
/* `query.term` is the text the user typed after the '@' */
users = users.filter((user) => user.name.toLowerCase().includes(query.term.toLowerCase()))
users = users.slice(0, 10);
// Where the user object must contain the properties `id` and `name`
// but you could additionally include anything else you deem useful.
/* Where the user object must contain the properties `id` and `name`
but you could additionally include anything else you deem useful. */
success(users);
});
}
Expand Down

0 comments on commit a859092

Please sign in to comment.