summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/filtered_search/dropdown_hint.js.es612
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_hint.js.es6 b/app/assets/javascripts/filtered_search/dropdown_hint.js.es6
index b09136586c8..0bee2eb2986 100644
--- a/app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+++ b/app/assets/javascripts/filtered_search/dropdown_hint.js.es6
@@ -42,6 +42,18 @@
super.renderContent();
droplab.setData(this.hookId, dropdownData);
}
+
+ filterMethod(item, query) {
+ const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
+
+ if (value === '') {
+ item.droplab_hidden = false;
+ } else {
+ item.droplab_hidden = item['hint'].indexOf(value) === -1;
+ }
+
+ return item;
+ }
}
global.DropdownHint = DropdownHint;