Skip to content

Commit

Permalink
Update burger-menu.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinaHranovska committed Feb 14, 2024
1 parent b394e30 commit 6181f05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/burger-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
const currentPath = window.location.pathname;
const targetPage = 'favorites.html';

console.log(currentPath)

if (currentPath === '/' + targetPage) {
if (currentPath.endsWith(targetPage)) {
console.log('FAVORITES')
Array.from(favoritesButtons).forEach(button => button.classList.add('active-link'));
Array.from(homeButtons).forEach(button => button.classList.remove('active-link'));
} else {
console.log('HOME')
Array.from(homeButtons).forEach(button => button.classList.add('active-link'));
Array.from(favoritesButtons).forEach(button => button.classList.remove('active-link'));
}
Expand Down

0 comments on commit 6181f05

Please sign in to comment.