Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-12-10 00:47:56 +0300
committerClement Ho <ClemMakesApps@gmail.com>2017-01-10 01:01:12 +0300
commit88ed015915e63c07181122c461523d3e1610e98e (patch)
tree5365c663d4799924894b90637fa743883a4a9654 /app
parente5b061b801ee7b806dd401c97a5b268e3f34859a (diff)
Fix clear button so that it resets the dropdowns properly
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es64
-rw-r--r--app/assets/javascripts/filtered_search/filtered_search_manager.js.es68
2 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
index 163dac65842..03835b6522b 100644
--- a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
+++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
@@ -117,6 +117,10 @@
item.droplab_hidden = !match && !matchWithoutPrefix;
return item;
}
+
+ hideDropdown() {
+ this.getCurrentHook().list.hide();
+ }
}
global.FilteredSearchDropdown = FilteredSearchDropdown;
diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js.es6 b/app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
index d21ae70cdb9..0654d7d816a 100644
--- a/app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
+++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
@@ -246,7 +246,15 @@
this.filteredSearchInput.value = '';
this.clearSearchButton.classList.add('hidden');
+
+ // Force dropdown to hide
+ this.mapping[this.currentDropdown].reference.hideDropdown();
+
+ // Re-Load dropdown
this.setDropdown();
+
+ // Reposition dropdown so that it is aligned with cursor
+ this.updateDropdownOffset(this.currentDropdown);
}
checkForBackspace(e) {