Skip to content

Conversation

@iashishkpal
Copy link

Issue :

  1. The event listener for nav-mobile-btn is repeated twice. This causes redundant code and adds two identical event listeners to the same element.
  2. The code directly tries to access document.getElementById("year").innerHTML = year without checking if the element exists. If there’s no element with the ID year, this will cause an error.

Solution :

  1. The second, repeated block for nav-mobile-btn was removed.
  2. Added a check to ensure document.getElementById("year") exists before setting its innerHTML.
Issue : 1. The event listener for nav-mobile-btn is repeated twice. This causes redundant code and adds two identical event listeners to the same element. 2. The code directly tries to access document.getElementById("year").innerHTML = year without checking if the element exists. If there’s no element with the ID year, this will cause an error. Solution : 1. The second, repeated block for nav-mobile-btn was removed. 2. Added a check to ensure document.getElementById("year") exists before setting its innerHTML.
@what-the-diff
Copy link

what-the-diff bot commented Oct 27, 2024

PR Summary

  • Simplified Mobile Navigation Code
    The PR removed some superfluous comments and unnecessary codes related to the mobile navigation button to create a cleaner, more efficient code.

  • Current Year Dynamic Setting
    A new function was added that automatically sets and updates the current year in the #year element, if it’s available on the web page. This means no manual updates will be necessary every year.

  • Improved Mobile Navigation Toggle
    While refining the mobile navigation code, the toggle functionality has been retained and clarified. This means that mobile users can continue to comfortably navigate through the website with a clearer, simplified code base.

@iashishkpal
Copy link
Author

please merge my pull request.

@bobbyiliev
Copy link
Owner

Thank you for the suggestion, but it is not really an issue as it is. I will close the PR for the moment.

@bobbyiliev bobbyiliev closed this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants