Commit 8a910ba2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve projects/groups list js code

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1d49d065
...@@ -7,8 +7,6 @@ export default class FilterableList { ...@@ -7,8 +7,6 @@ export default class FilterableList {
this.filterForm = form; this.filterForm = form;
this.listFilterElement = filter; this.listFilterElement = filter;
this.listHolderElement = holder; this.listHolderElement = holder;
this.initSearch();
} }
initSearch() { initSearch() {
......
...@@ -6,10 +6,13 @@ import FilterableList from './filterable_list'; ...@@ -6,10 +6,13 @@ import FilterableList from './filterable_list';
*/ */
export default class GroupsList { export default class GroupsList {
constructor() { constructor() {
var form = document.querySelector('form#group-filter-form'); const form = document.querySelector('form#group-filter-form');
var filter = document.querySelector('.js-groups-list-filter'); const filter = document.querySelector('.js-groups-list-filter');
var holder = document.querySelector('.js-groups-list-holder'); 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'; ...@@ -6,10 +6,13 @@ import FilterableList from './filterable_list';
*/ */
export default class ProjectsList { export default class ProjectsList {
constructor() { constructor() {
var form = document.querySelector('form#project-filter-form'); const form = document.querySelector('form#project-filter-form');
var filter = document.querySelector('.js-projects-list-filter'); const filter = document.querySelector('.js-projects-list-filter');
var holder = document.querySelector('.js-projects-list-holder'); 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();
}
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment