Skip to content
Extraits de code Groupes Projets
Valider f073a96b rédigé par Dennis Schubert's avatar Dennis Schubert
Parcourir les fichiers

Merge pull request #6788 from svbergerem/improve-search-suggestions

Improve search and mentions suggestions
parents a414fb23 75384d50
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -95,6 +95,7 @@ Contributions are very welcome, the hard work is done! ...@@ -95,6 +95,7 @@ Contributions are very welcome, the hard work is done!
* Prune and do not create aspect visibilities for public posts [#6732](https://github.com/diaspora/diaspora/pull/6732) * Prune and do not create aspect visibilities for public posts [#6732](https://github.com/diaspora/diaspora/pull/6732)
* Optimized mobile login and registration forms [#6764](https://github.com/diaspora/diaspora/pull/6764) * Optimized mobile login and registration forms [#6764](https://github.com/diaspora/diaspora/pull/6764)
* Redesign stream pages [#6535](https://github.com/diaspora/diaspora/pull/6535) * Redesign stream pages [#6535](https://github.com/diaspora/diaspora/pull/6535)
* Improve search and mentions suggestions [#6788](https://github.com/diaspora/diaspora/pull/6788)
## Bug fixes ## Bug fixes
* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852) * Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852)
......
...@@ -18,9 +18,11 @@ app.views.SearchBase = app.views.Base.extend({ ...@@ -18,9 +18,11 @@ app.views.SearchBase = app.views.Base.extend({
setupBloodhound: function(options) { setupBloodhound: function(options) {
var bloodhoundOptions = { var bloodhoundOptions = {
datumTokenizer: function(datum) { datumTokenizer: function(datum) {
var nameTokens = this.bloodhoundTokenizer(datum.name); // hashtags
var handleTokens = datum.handle ? this.bloodhoundTokenizer(datum.handle) : []; if(typeof datum.handle === "undefined") { return [datum.name]; }
return nameTokens.concat(handleTokens); // people
if(datum.name === datum.handle) { return [datum.handle]; }
return this.bloodhoundTokenizer(datum.name).concat(datum.handle);
}.bind(this), }.bind(this),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: { prefetch: {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter