Commit b169046e authored by Alfredo Sumaran's avatar Alfredo Sumaran

Initialize autocomplete only when search form is present

parent 4c268027
...@@ -146,10 +146,11 @@ class Dispatcher ...@@ -146,10 +146,11 @@ class Dispatcher
when 'project_members', 'deploy_keys', 'hooks', 'services', 'protected_branches' when 'project_members', 'deploy_keys', 'hooks', 'services', 'protected_branches'
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
# If we haven't installed a custom shortcut handler, install the default one # If we haven't installed a custom shortcut handler, install the default one
if not shortcut_handler if not shortcut_handler
new Shortcuts() new Shortcuts()
initSearch: -> initSearch: ->
new SearchAutocomplete()
# Only when search form is present
new SearchAutocomplete() if $('.search').length
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment