Initialize autocomplete only when search form is present

This commit is contained in:
Alfredo Sumaran 2016-03-26 17:56:51 -05:00
parent 4c268027d2
commit b169046e57

View file

@ -146,10 +146,11 @@ class Dispatcher
when 'project_members', 'deploy_keys', 'hooks', 'services', 'protected_branches'
shortcut_handler = new ShortcutsNavigation()
# If we haven't installed a custom shortcut handler, install the default one
if not shortcut_handler
new Shortcuts()
initSearch: ->
new SearchAutocomplete()
# Only when search form is present
new SearchAutocomplete() if $('.search').length