2022-01-07 07:10:47 -05:00
|
|
|
import FilterableList from '~/filterable_list';
|
2017-03-03 05:13:03 -05:00
|
|
|
|
2017-03-02 06:05:48 -05:00
|
|
|
/**
|
|
|
|
* Makes search request for groups when user types a value in the search input.
|
|
|
|
* Updates the html content of the page with the received one.
|
|
|
|
*/
|
|
|
|
export default class GroupsList {
|
|
|
|
constructor() {
|
2017-03-04 06:04:00 -05:00
|
|
|
const form = document.querySelector('form#group-filter-form');
|
|
|
|
const filter = document.querySelector('.js-groups-list-filter');
|
|
|
|
const holder = document.querySelector('.js-groups-list-holder');
|
2017-03-02 06:05:48 -05:00
|
|
|
|
2017-03-04 06:04:00 -05:00
|
|
|
if (form && filter && holder) {
|
|
|
|
const list = new FilterableList(form, filter, holder);
|
|
|
|
list.initSearch();
|
|
|
|
}
|
2017-03-02 06:05:48 -05:00
|
|
|
}
|
|
|
|
}
|