-
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
05-dom-document-loading #5
Conversation
Добавляю преподавателя (@ufocoder) для код-ревью. |
this.element = this.createElement(this.createTemplate()); | ||
} | ||
|
||
show(targetElement) { |
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.
show(targetElement = document.body) {
и не нужно ниже условия
|
||
createBodyCellTemplate(dataItem) { | ||
return this.headerConfig.map(({id, template}) => { | ||
if (id === 'images') { |
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.
if (template) {
} | ||
|
||
sort(field, direction) { | ||
const newData = [...this.data]; |
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.
В чем необходимость создавать новый массив?
Добавляю преподавателя (@ufocoder) для код-ревью. |
Решение было обновлено, посмотрим что скажет @ufocoder |
}).join(' '); | ||
} | ||
|
||
sort(field, direction) { |
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.
Достаточно найти тип сортировки по значние field в this.headerConfig
} | ||
|
||
createListeners() { | ||
document.body.addEventListener('pointerdown', (e) => this.handleTableHeaderPointerdown(e)); |
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.
необходимо добавлять и удалять одни и те же обработчики
document.body.removeEventListener('pointerdown', (e) => this.handleTableHeaderPointerdown(e)); | ||
} | ||
|
||
handleTableHeaderPointerdown(e) { |
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.
createListeners() {
document.body.addEventListener('pointerdown', this.handleTableHeaderPointerdown);
}
destroyListeners() {
document.body.removeEventListener('pointerdown', this.handleTableHeaderPointerdown);
}
handleTableHeaderPointerdown = (e) => {
Добавляю преподавателя (@ufocoder) для код-ревью. |
05-dom-document-loading