diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-13 06:07:42 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-10 01:01:22 +0300 |
commit | 98cb6101ec45e8758a9e85a3a24fcde9803ece18 (patch) | |
tree | 4e625ae69fdcbc312c897a2df5ac5cf93f1b25a8 /app | |
parent | e9886b5704ae60a0e3517205de3958e9c0044a99 (diff) |
Refactor static data to get information from other variables instead
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_user.js.es6 | 4 | ||||
-rw-r--r-- | app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_user.js.es6 b/app/assets/javascripts/filtered_search/dropdown_user.js.es6 index 8bc274e0b12..69b1ec3ea04 100644 --- a/app/assets/javascripts/filtered_search/dropdown_user.js.es6 +++ b/app/assets/javascripts/filtered_search/dropdown_user.js.es6 @@ -15,7 +15,7 @@ project_id: this.getProjectId(), current_user: true, }, - searchValueFunction: this.getSearchInput, + searchValueFunction: this.getSearchInput.bind(this), loadingTemplate: this.loadingTemplate, }, }; @@ -37,7 +37,7 @@ } getSearchInput() { - const query = document.querySelector('.filtered-search').value; + const query = this.input.value; const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query); const valueWithoutColon = value.slice(1); const hasPrefix = valueWithoutColon[0] === '@'; 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 130e6bba341..a5d8b0969c6 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 @@ -5,7 +5,7 @@ class FilteredSearchDropdown { constructor(droplab, dropdown, input) { this.droplab = droplab; - this.hookId = 'filtered-search'; + this.hookId = input.getAttribute('data-id'); this.input = input; this.dropdown = dropdown; this.loadingTemplate = `<div class="filter-dropdown-loading"> |