Refactor static data to get information from other variables instead
This commit is contained in:
parent
e9886b5704
commit
98cb6101ec
2 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@
|
||||||
project_id: this.getProjectId(),
|
project_id: this.getProjectId(),
|
||||||
current_user: true,
|
current_user: true,
|
||||||
},
|
},
|
||||||
searchValueFunction: this.getSearchInput,
|
searchValueFunction: this.getSearchInput.bind(this),
|
||||||
loadingTemplate: this.loadingTemplate,
|
loadingTemplate: this.loadingTemplate,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
getSearchInput() {
|
getSearchInput() {
|
||||||
const query = document.querySelector('.filtered-search').value;
|
const query = this.input.value;
|
||||||
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
|
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
|
||||||
const valueWithoutColon = value.slice(1);
|
const valueWithoutColon = value.slice(1);
|
||||||
const hasPrefix = valueWithoutColon[0] === '@';
|
const hasPrefix = valueWithoutColon[0] === '@';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
class FilteredSearchDropdown {
|
class FilteredSearchDropdown {
|
||||||
constructor(droplab, dropdown, input) {
|
constructor(droplab, dropdown, input) {
|
||||||
this.droplab = droplab;
|
this.droplab = droplab;
|
||||||
this.hookId = 'filtered-search';
|
this.hookId = input.getAttribute('data-id');
|
||||||
this.input = input;
|
this.input = input;
|
||||||
this.dropdown = dropdown;
|
this.dropdown = dropdown;
|
||||||
this.loadingTemplate = `<div class="filter-dropdown-loading">
|
this.loadingTemplate = `<div class="filter-dropdown-loading">
|
||||||
|
|
Loading…
Reference in a new issue