Improve projects/groups list js code

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2017-03-04 13:04:00 +02:00
parent 1d49d065ed
commit 8a910ba297
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
3 changed files with 14 additions and 10 deletions

View file

@ -7,8 +7,6 @@ export default class FilterableList {
this.filterForm = form;
this.listFilterElement = filter;
this.listHolderElement = holder;
this.initSearch();
}
initSearch() {

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}