Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup botathon/index.php navigation panel script #157

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Kenneth-W-Chen
Copy link
Member

This change adjusts the code in the botathon/index.php page so that jQuery objects aren't continuously re-queried every time the page is scrolled. see 8951811

Other changes:

  • Navigation panel classes are changed using native JS DOM selectors instead of jQuery because there's no reason to use jQuery in those cases. See 8951811, specifically, the changes to the function switchActive and the addition of the var navAnchors
  • The initial state of the navigation panel is set properly. Previously, if the page's scroll position was set before the script could load (e.g., the user scrolls down and reloads the page, and the browser keeps the page scroll constant between loads), the active navigation anchor would always be the first one. See 04a3e43
  • Refactoring. Renaming some variables and functions and changing scopes for variables and functions so that jQuery isn't continuously re-queried. Also changed to use let instead of var. See 7c81cfa

Also adjusted nav class changing to use DOM instead of jquery since jquery wasn't needed for that
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.

None yet

1 participant