mirror of
https://github.com/Nezumi-2711/javascript-training.git
synced 2026-09-22 20:01:31 +00:00
Update code
This commit is contained in:
@@ -9,7 +9,6 @@ export default class HomeView extends CommonView {
|
||||
this.addTransactionBtn = document.getElementById('addTransaction');
|
||||
this.addBudgetBtn = document.getElementById('addBudget');
|
||||
this.dialogs = document.querySelectorAll('.dialog');
|
||||
this.cancelBtn = document.querySelectorAll('.form__cancel-btn');
|
||||
this.categoryField = document.getElementById('selectCategory');
|
||||
this.closeIcon = document.querySelector('.close-icon');
|
||||
|
||||
@@ -29,11 +28,8 @@ export default class HomeView extends CommonView {
|
||||
|
||||
const line = document.querySelector('.app__line');
|
||||
|
||||
if (line.classList.contains('left')) {
|
||||
HomeView.replaceClassElement('left', 'right', line);
|
||||
} else {
|
||||
HomeView.replaceClassElement('right', 'left', line);
|
||||
}
|
||||
line.classList.toggle('right', line.classList.contains('left'));
|
||||
line.classList.toggle('left', !line.classList.contains('right'));
|
||||
|
||||
this.allContent.forEach((content) => {
|
||||
content.classList.remove('active');
|
||||
@@ -43,11 +39,6 @@ export default class HomeView extends CommonView {
|
||||
});
|
||||
}
|
||||
|
||||
static replaceClassElement(oldEl, newEl, el) {
|
||||
el.classList.remove(oldEl);
|
||||
el.classList.add(newEl);
|
||||
}
|
||||
|
||||
addCommonEventPage() {
|
||||
// Add event close dialog when click outside
|
||||
this.dialogs.forEach((dialog) => {
|
||||
|
||||
Reference in New Issue
Block a user