Skip to content

Solution#1749

Open
shvxmlk wants to merge 1 commit intomate-academy:masterfrom
shvxmlk:develop
Open

Solution#1749
shvxmlk wants to merge 1 commit intomate-academy:masterfrom
shvxmlk:develop

Conversation

@shvxmlk
Copy link
Copy Markdown

@shvxmlk shvxmlk commented Apr 20, 2026

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved because the gallery behaves correctly: clicking any thumbnail (whether on the img or its surrounding a) updates the main image using event delegation on the .gallery container. The logic that finds the nearest anchor with closest('a') and then assigns mainImage.src = link.href satisfies the core functional requirements for this task. In src/scripts/main.js, within the .gallery click handler (around the middle of the file where you currently call e.preventDefault() at the top of the handler), consider moving e.preventDefault() to after you have confirmed that a valid link was found so that unrelated clicks inside .gallery are not unnecessarily blocked. Also in that same area of the file, it would be more robust to guard against missing DOM elements by checking that document.querySelector('.gallery') and document.querySelector('.gallery__img') both return non-null before you add listeners or update src. Outside the JS code, remember that the assignment expects you to replace the <your_account> placeholder in the demo link (e.g., in the README or project description) with your actual GitHub username so the published demo URL works for reviewers. These are minor improvements; the main behavior is solid and matches the task requirements well, so you can treat this as an opportunity to further polish already working code.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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.

2 participants