Skip to content

Commit

Permalink
Update modal-window.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinaHranovska committed Feb 13, 2024
1 parent fdbb4c3 commit fa9b43f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/modal-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { getAccess } from './helper/get-access';
const backdrop = document.querySelector('.backdrop-thumb');
const closeIcon = document.querySelector('.js-modal-window');
const galleryWindow = document.querySelector('.js-gallery');

const link = document.querySelector('.link-home');
console.log(link);
const isActiveLink = link.classList.contains('active-link');
const isActiveLink = link.getAttribute('href');
console.log(isActiveLink);
const currentPage = window.location.pathname;

// Якщо поточна сторінка - index.html, то показуємо блок з кнопкою
if (currentPage.includes('index.html') || isActiveLink) {
if (currentPage.includes('index.html') || isActiveLink === './index.html') {
console.log(isActiveLink);
const removeCards = document.querySelector('.buttons-modal');
if (removeCards) {
removeCards.classList.remove('visually-hidden');
Expand Down

0 comments on commit fa9b43f

Please sign in to comment.