Skip to content

Commit a859092

Browse files
committed
DOC-2579: Update the example using mentions_fetch to reflect demo changes.
1 parent 4ee1ed8 commit a859092

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

modules/ROOT/partials/configuration/mentions_fetch.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ tinymce.init({
2626
usersRequest = fetch('/users');
2727
}
2828
usersRequest.then((users) => {
29-
// query.term is the text the user typed after the '@'
30-
users = users.filter((user) => {
31-
return user.name.indexOf(query.term.toLowerCase()) !== -1;
32-
});
29+
/* `query.term` is the text the user typed after the '@' */
30+
users = users.filter((user) => user.name.toLowerCase().includes(query.term.toLowerCase()))
3331
3432
users = users.slice(0, 10);
3533
36-
// Where the user object must contain the properties `id` and `name`
37-
// but you could additionally include anything else you deem useful.
34+
/* Where the user object must contain the properties `id` and `name`
35+
but you could additionally include anything else you deem useful. */
3836
success(users);
3937
});
4038
}

0 commit comments

Comments
 (0)