diff options
Diffstat (limited to 'app/assets/javascripts/search_autocomplete.js')
-rw-r--r-- | app/assets/javascripts/search_autocomplete.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 9c133a79607..4f278677c5f 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -4,16 +4,17 @@ import $ from 'jquery'; import { escape, throttle } from 'lodash'; import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; import { getIdenticonBackgroundClass, getIdenticonTitle } from '~/helpers/avatar_helper'; +import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import { s__, __, sprintf } from '~/locale'; import Tracking from '~/tracking'; import axios from './lib/utils/axios_utils'; +import { spriteIcon } from './lib/utils/common_utils'; import { isInGroupsPage, isInProjectPage, getGroupSlug, getProjectSlug, - spriteIcon, -} from './lib/utils/common_utils'; +} from './search_autocomplete_utils'; /** * Search input in top navigation bar. @@ -343,7 +344,10 @@ export class SearchAutocomplete { this.searchInput.on('focus', this.onSearchInputFocus); this.searchInput.on('blur', this.onSearchInputBlur); this.clearInput.on('click', this.onClearInputClick); - this.dropdownContent.on('scroll', throttle(this.setScrollFade, 250)); + this.dropdownContent.on( + 'scroll', + throttle(this.setScrollFade, DEFAULT_DEBOUNCE_AND_THROTTLE_MS), + ); this.searchInput.on('click', (e) => { e.stopPropagation(); |