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

05-dom-document-loading #5

Merged
merged 8 commits into from
Feb 13, 2025
Merged

05-dom-document-loading #5

merged 8 commits into from
Feb 13, 2025

Conversation

AlexIgn88
Copy link

05-dom-document-loading

@jsru-1
Copy link
Contributor

jsru-1 commented Feb 10, 2025

Добавляю преподавателя (@ufocoder) для код-ревью.

this.element = this.createElement(this.createTemplate());
}

show(targetElement) {

Choose a reason for hiding this comment

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

show(targetElement = document.body) { и не нужно ниже условия


createBodyCellTemplate(dataItem) {
return this.headerConfig.map(({id, template}) => {
if (id === 'images') {

Choose a reason for hiding this comment

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

if (template) {

}

sort(field, direction) {
const newData = [...this.data];

Choose a reason for hiding this comment

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

В чем необходимость создавать новый массив?

@jsru-1
Copy link
Contributor

jsru-1 commented Feb 11, 2025

Добавляю преподавателя (@ufocoder) для код-ревью.

@jsru-1 jsru-1 requested a review from ufocoder February 11, 2025 16:22
@jsru-1
Copy link
Contributor

jsru-1 commented Feb 12, 2025

Решение было обновлено, посмотрим что скажет @ufocoder

}).join(' ');
}

sort(field, direction) {

Choose a reason for hiding this comment

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

Достаточно найти тип сортировки по значние field в this.headerConfig

}

createListeners() {
document.body.addEventListener('pointerdown', (e) => this.handleTableHeaderPointerdown(e));

Choose a reason for hiding this comment

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

необходимо добавлять и удалять одни и те же обработчики

document.body.removeEventListener('pointerdown', (e) => this.handleTableHeaderPointerdown(e));
}

handleTableHeaderPointerdown(e) {
Copy link

@ufocoder ufocoder Feb 12, 2025

Choose a reason for hiding this comment

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

  createListeners() {
    document.body.addEventListener('pointerdown', this.handleTableHeaderPointerdown);
  }

  destroyListeners() {
    document.body.removeEventListener('pointerdown', this.handleTableHeaderPointerdown);
  }

  handleTableHeaderPointerdown = (e) => {

@jsru-1
Copy link
Contributor

jsru-1 commented Feb 13, 2025

Добавляю преподавателя (@ufocoder) для код-ревью.

@jsru-1 jsru-1 requested a review from ufocoder February 13, 2025 09:03
@jsru-1 jsru-1 merged commit e6bafed into js-tasks-ru:master Feb 13, 2025
1 check 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.

3 participants