Skip to content

Commit

Permalink
Merge pull request #15 from licos87/module8-task3
Browse files Browse the repository at this point in the history
Дополнительная функциональность
  • Loading branch information
AlSudar authored Oct 18, 2024
2 parents 2612480 + 8eb6899 commit e61aa3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/presenter/list-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default class ListPresenter {

#sortComponent = null;
#currentSortType = SortType.DAY;
#filterType = FilterType.EVERYTHING;
#isLoading = true;

#uiBlocker = new UiBlocker({
Expand Down Expand Up @@ -72,9 +71,8 @@ export default class ListPresenter {
}

get tripPoints() {
this.#filterType = this.#filtersModel.filter;
const tripPoints = this.#pointsTripModel.points;
const filteredTripPoints = filter[this.#filterType](tripPoints);
const filteredTripPoints = filter[this.#filtersModel.filter](tripPoints);
switch (this.#currentSortType) {
case SortType.DAY:
return filteredTripPoints.sort(sortEventsByDay);
Expand Down
4 changes: 3 additions & 1 deletion src/view/filters-events-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function createFiltersEventsTemplate(filters, currentFilterType) {
type="radio"
name="trip-filter"
value="${filter.type}"
${filter.type === currentFilterType && 'checked'}>
${filter.type === currentFilterType && 'checked'}
${filter.count === 0 ? 'disabled' : ''}
>
<label class="trip-filters__filter-label" for="filter-${filter.type}">${filter.type}</label>
</div>
`)).join('')}
Expand Down

0 comments on commit e61aa3d

Please sign in to comment.