Refactor static data to get information from other variables instead

This commit is contained in:
Clement Ho 2016-12-12 21:07:42 -06:00
parent e9886b5704
commit 98cb6101ec
2 changed files with 3 additions and 3 deletions

View File

@ -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] === '@';

View File

@ -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">