summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/search_autocomplete.js
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-12-04 14:41:33 -0700
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-12-05 11:03:28 -0700
commit716ac262032890fb771f410bd5f2c5444f51c2e2 (patch)
treecfe3384615d642c1c5c7d089b412e1bca2fe60ec /app/assets/javascripts/search_autocomplete.js
parentf3a3bd50eafdcfcaeea21d6cfa0b8bbae7720fec (diff)
downloadgitlab-ce-716ac262032890fb771f410bd5f2c5444f51c2e2.tar.gz
Close all open dropdowns when search input is clicked
Diffstat (limited to 'app/assets/javascripts/search_autocomplete.js')
-rw-r--r--app/assets/javascripts/search_autocomplete.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js
index 9dec5d7645a..5eb38006e61 100644
--- a/app/assets/javascripts/search_autocomplete.js
+++ b/app/assets/javascripts/search_autocomplete.js
@@ -281,6 +281,8 @@ import { isInGroupsPage, isInProjectPage, getGroupSlug, getProjectSlug } from '.
// Avoid falsy value to be returned
onSearchInputClick(e) {
+ $('.dropdown.open .dropdown-toggle').dropdown('toggle');
+ this.dropdown.dropdown('toggle');
return e.stopImmediatePropagation();
}
@@ -305,6 +307,7 @@ import { isInGroupsPage, isInProjectPage, getGroupSlug, getProjectSlug } from '.
onSearchInputBlur(e) {
this.isFocused = false;
this.wrap.removeClass('search-active');
+ $('.search-input-wrap').removeClass('open');
// If input is blank then restore state
if (this.searchInput.val() === '') {
return this.restoreOriginalState();