diff options
Diffstat (limited to 'app/assets/javascripts/search_autocomplete.js')
-rw-r--r-- | app/assets/javascripts/search_autocomplete.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 990c8faf253..7073b9ca12d 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -13,6 +13,7 @@ import { spriteIcon, } from './lib/utils/common_utils'; import Tracking from '~/tracking'; +import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; /** * Search input in top navigation bar. @@ -119,7 +120,7 @@ export class SearchAutocomplete { } createAutocomplete() { - return this.searchInput.glDropdown({ + return initDeprecatedJQueryDropdown(this.searchInput, { filterInputBlur: false, filterable: true, filterRemote: true, @@ -134,6 +135,7 @@ export class SearchAutocomplete { data: this.getData.bind(this), selectable: true, clicked: this.onClick.bind(this), + trackSuggestionClickedLabel: 'search_autocomplete_suggestion', }); } @@ -145,10 +147,10 @@ export class SearchAutocomplete { if (!term) { const contents = this.getCategoryContents(); if (contents) { - const glDropdownInstance = this.searchInput.data('glDropdown'); + const deprecatedJQueryDropdownInstance = this.searchInput.data('deprecatedJQueryDropdown'); - if (glDropdownInstance) { - glDropdownInstance.filter.options.callback(contents); + if (deprecatedJQueryDropdownInstance) { + deprecatedJQueryDropdownInstance.filter.options.callback(contents); } this.enableAutocomplete(); } @@ -463,7 +465,7 @@ export class SearchAutocomplete { } highlightFirstRow() { - this.searchInput.data('glDropdown').highlightRowAtIndex(null, 0); + this.searchInput.data('deprecatedJQueryDropdown').highlightRowAtIndex(null, 0); } getAvatar(item) { |