Commit f9646d3e authored by Douwe Maan's avatar Douwe Maan

Highlight first user autocomplete option

parent c69e3942
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
DefaultOptions: { DefaultOptions: {
sorter: function(query, items, searchKey) { sorter: function(query, items, searchKey) {
// Highlight first item only if at least one char was typed // Highlight first item only if at least one char was typed
this.setting.highlightFirst = query.length > 0; this.setting.highlightFirst = this.setting.alwaysHighlightFirst || query.length > 0;
if ((items[0].name != null) && items[0].name === 'loading') { if ((items[0].name != null) && items[0].name === 'loading') {
return items; return items;
} }
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
insertTpl: '${atwho-at}${username}', insertTpl: '${atwho-at}${username}',
searchKey: 'search', searchKey: 'search',
data: ['loading'], data: ['loading'],
alwaysHighlightFirst: true,
callbacks: { callbacks: {
sorter: this.DefaultOptions.sorter, sorter: this.DefaultOptions.sorter,
filter: this.DefaultOptions.filter, filter: this.DefaultOptions.filter,
...@@ -363,4 +364,3 @@ ...@@ -363,4 +364,3 @@
}; };
}).call(this); }).call(this);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment