-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
src/main.js
Outdated
@@ -18,6 +22,10 @@ const listPresenter = new ListPresenter({ | |||
offersTripModel, | |||
}); | |||
|
|||
const filters = generateFilter(); | |||
|
|||
render(new TripFiltersFormView({filters}), tripFiltersElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне кажется лучше рендерить фильтры внутри ListPresenter, т.к. список точек маршрутра и фильтрация - это взаимосвязанные вещи
src/presenter/list-presenter.js
Outdated
|
||
/** Рендерим кнопки сортировки */ | ||
this.#renderSort(); |
There was a problem hiding this comment.
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); . В будущем могут возникнуть ситуации в которых нам надо перерендерить список, но не перерендеривать эти два элемента. В целом лучше разделять на разные методы рендеры разных кусков нашего приложения
…в отдельный презентер
Ваш пулреквест опубликован. Посмотреть можно здесь |
🎓 Шаблонизируй то