summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-11-17 11:28:25 +0200
committerDouwe Maan <douwe@selenight.nl>2016-11-17 12:08:30 +0200
commitf9646d3e04a41aaeb6a2e604622ecad88a961641 (patch)
tree742a365de5c0e7896833b6feddfa731c02439b33
parentc69e3942e8d4094f6f322eb2b843ad99b9a7e2bf (diff)
downloadgitlab-ce-highlight-first-user-autocomplete-option.tar.gz
Highlight first user autocomplete optionhighlight-first-user-autocomplete-option
-rw-r--r--app/assets/javascripts/gfm_auto_complete.js.es64
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.es6 b/app/assets/javascripts/gfm_auto_complete.js.es6
index 19bfdf1de8c..0253f36c21b 100644
--- a/app/assets/javascripts/gfm_auto_complete.js.es6
+++ b/app/assets/javascripts/gfm_auto_complete.js.es6
@@ -35,7 +35,7 @@
DefaultOptions: {
sorter: function(query, items, searchKey) {
// 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') {
return items;
}
@@ -117,6 +117,7 @@
insertTpl: '${atwho-at}${username}',
searchKey: 'search',
data: ['loading'],
+ alwaysHighlightFirst: true,
callbacks: {
sorter: this.DefaultOptions.sorter,
filter: this.DefaultOptions.filter,
@@ -363,4 +364,3 @@
};
}).call(this);
-