Improve projects/groups list js code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
1d49d065ed
commit
8a910ba297
3 changed files with 14 additions and 10 deletions
|
@ -7,8 +7,6 @@ export default class FilterableList {
|
|||
this.filterForm = form;
|
||||
this.listFilterElement = filter;
|
||||
this.listHolderElement = holder;
|
||||
|
||||
this.initSearch();
|
||||
}
|
||||
|
||||
initSearch() {
|
||||
|
|
|
@ -6,10 +6,13 @@ import FilterableList from './filterable_list';
|
|||
*/
|
||||
export default class GroupsList {
|
||||
constructor() {
|
||||
var form = document.querySelector('form#group-filter-form');
|
||||
var filter = document.querySelector('.js-groups-list-filter');
|
||||
var holder = document.querySelector('.js-groups-list-holder');
|
||||
const form = document.querySelector('form#group-filter-form');
|
||||
const filter = document.querySelector('.js-groups-list-filter');
|
||||
const holder = document.querySelector('.js-groups-list-holder');
|
||||
|
||||
new FilterableList(form, filter, holder);
|
||||
if (form && filter && holder) {
|
||||
const list = new FilterableList(form, filter, holder);
|
||||
list.initSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,13 @@ import FilterableList from './filterable_list';
|
|||
*/
|
||||
export default class ProjectsList {
|
||||
constructor() {
|
||||
var form = document.querySelector('form#project-filter-form');
|
||||
var filter = document.querySelector('.js-projects-list-filter');
|
||||
var holder = document.querySelector('.js-projects-list-holder');
|
||||
const form = document.querySelector('form#project-filter-form');
|
||||
const filter = document.querySelector('.js-projects-list-filter');
|
||||
const holder = document.querySelector('.js-projects-list-holder');
|
||||
|
||||
new FilterableList(form, filter, holder);
|
||||
if (form && filter && holder) {
|
||||
const list = new FilterableList(form, filter, holder);
|
||||
list.initSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue