2019-07-04 18:30:34 -04:00
|
|
|
import ProjectsFilterableList from './projects/projects_filterable_list';
|
2016-12-14 00:26:26 -05:00
|
|
|
|
2017-03-03 05:13:03 -05:00
|
|
|
/**
|
|
|
|
* Makes search request for projects when user types a value in the search input.
|
|
|
|
* Updates the html content of the page with the received one.
|
|
|
|
*/
|
|
|
|
export default class ProjectsList {
|
|
|
|
constructor() {
|
2017-03-04 06:04:00 -05:00
|
|
|
const form = document.querySelector('form#project-filter-form');
|
|
|
|
const filter = document.querySelector('.js-projects-list-filter');
|
|
|
|
const holder = document.querySelector('.js-projects-list-holder');
|
2017-03-03 05:13:03 -05:00
|
|
|
|
2017-03-04 06:04:00 -05:00
|
|
|
if (form && filter && holder) {
|
2019-07-04 18:30:34 -04:00
|
|
|
const list = new ProjectsFilterableList(form, filter, holder);
|
2017-03-04 06:04:00 -05:00
|
|
|
list.initSearch();
|
|
|
|
}
|
2017-03-03 05:13:03 -05:00
|
|
|
}
|
|
|
|
}
|