Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Шаблонизируй то #6

Merged
merged 5 commits into from
Sep 29, 2024

Conversation

licos87
Copy link
Contributor

@licos87 licos87 commented Sep 27, 2024

src/main.js Outdated
@@ -18,6 +22,10 @@ const listPresenter = new ListPresenter({
offersTripModel,
});

const filters = generateFilter();

render(new TripFiltersFormView({filters}), tripFiltersElement);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется лучше рендерить фильтры внутри ListPresenter, т.к. список точек маршрутра и фильтрация - это взаимосвязанные вещи


/** Рендерим кнопки сортировки */
this.#renderSort();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше вынести из этого метода #renderSort(); и render(new SectionTripInfoView({allDestinations: this.#destinations , allPoints: this.#listPoints}), tripMain, RenderPosition.AFTERBEGIN); . В будущем могут возникнуть ситуации в которых нам надо перерендерить список, но не перерендеривать эти два элемента. В целом лучше разделять на разные методы рендеры разных кусков нашего приложения

Copy link

Ваш пулреквест опубликован. Посмотреть можно здесь

github-actions bot pushed a commit that referenced this pull request Sep 29, 2024
@AlSudar AlSudar merged commit 3bff771 into htmlacademy-ecmascript:master Sep 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants