Skip to content

Vanilla navbar collapse; remove dead back-to-top + jQuery Easing (#1288)#1290

Merged
jonfroehlich merged 1 commit into
masterfrom
1288-navbar-collapse-vanilla
Jun 15, 2026
Merged

Vanilla navbar collapse; remove dead back-to-top + jQuery Easing (#1288)#1290
jonfroehlich merged 1 commit into
masterfrom
1288-navbar-collapse-vanilla

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Second step of Track A (#1288), the JS half of the Bootstrap+jQuery removal (#1253). Follows #1289.

What

Replaces the Bootstrap 3 collapse data-api on the mobile navbar with a small vanilla-JS handler, and removes dead front-end code found along the way.

top-navbar.js → vanilla (no jQuery):

  • Toggles the mobile menu via the in class — the same class Bootstrap's CSS already styles, so the look is unchanged and desktop is untouched (the menu is shown by CSS at ≥768px regardless).
  • Keeps aria-expanded in sync; closes the menu on nav-link click, outside click, and Escape (Escape also restores focus to the toggle — a small a11y win).

Removed as dead code:

  • backtop.js — never included in any template, and no #back-top element exists anywhere.
  • backtop.css + img/up-arrow.png — styled that nonexistent button.
  • jquery.easing.min.js — its only consumer was the "page-scroll" smooth scroll.
  • The top-nav-scrolled scroll handler (the class had no CSS rule anywhere — a no-op) and the page-scroll smooth scroll (only on the logo, whose href is a page URL, so it errored and fell through to normal navigation).

base.html: dropped the backtop.css link, the jquery.easing script, the toggle button's data-toggle="collapse"/data-target attrs, and the now-meaningless page-scroll class on the brand link.

Why

Removes the navbar's dependency on Bootstrap's collapse plugin and the jQuery Easing plugin, and clears ~4 dead files — shrinking the surface ahead of dropping jQuery/Bootstrap JS entirely (#1253). jQuery itself still loads (citation popover, carousel, sticky sidebar, Bootstrap still use it).

Verification

  • All pages return HTTP 200; removed refs (jquery.easing, backtop, data-toggle="collapse") are gone from served HTML.
  • Mobile collapse manually verified in-browser: open/close, close-on-nav-link, close-on-outside-click, and Escape all work; desktop nav unchanged.

No before/after screenshots: the only visual surface is the mobile menu open/close, which is behavior-identical to before (same .in class + Bootstrap CSS). The maintainer confirmed the toggle in-browser.

Note: the one behavioral nuance vs. Bootstrap is the menu now shows/hides instantly rather than sliding (Bootstrap's height animation). Intentional and minor.

Refs #1253.

Track A (#1253): replaces the Bootstrap 3 collapse data-api on the mobile
navbar with a small vanilla-JS handler, and clears out dead front-end code
uncovered while doing it.

top-navbar.js rewritten in vanilla JS (no jQuery):
- Toggles the mobile menu via the `in` class (same class Bootstrap's CSS
  already styles; desktop layout is unchanged — handled purely by CSS).
- Keeps `aria-expanded` in sync; closes on nav-link click, outside click,
  and Escape (Escape returns focus to the toggle — an a11y improvement).
- Dropped two behaviors that were already dead: the `top-nav-scrolled`
  scroll handler (no CSS rule for that class anywhere) and the jQuery-Easing
  "page-scroll" smooth scroll (only on the logo, whose href is a page URL, so
  it errored and fell through to normal navigation).

Removed as dead code:
- backtop.js — never included in any template; no `#back-top` element exists.
- backtop.css + img/up-arrow.png — styled that nonexistent button.
- jquery.easing.min.js — its only consumer was the page-scroll handler above.

base.html: dropped the backtop.css link, the jquery.easing script, the
navbar toggle's `data-toggle="collapse"`/`data-target` attrs (now vanilla),
and the now-meaningless `page-scroll` class on the brand link.

Verified locally: all pages 200, removed refs gone from served HTML, and the
mobile toggle (open/close, nav-link, outside-click, Escape) works in-browser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit f81ef7d into master Jun 15, 2026
1 check passed
jonfroehlich added a commit that referenced this pull request Jun 15, 2026
Bumps ML_WEBSITE_VERSION 2.4.0 -> 2.5.0. Marks the completion of Track A
(#1288): the frontend is now jQuery-free and Bootstrap-JS-free. Navbar (#1290),
citation popover (#1292), and carousels (#1293) rewritten in vanilla JS; dead
scrollspy (#1291), jQuery UI, jQuery Easing, and back-to-top removed
(#1289/#1290); jQuery 1.9.1 + Bootstrap 3.3.6 JS script tags dropped (#1295).
Bootstrap CSS unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich mentioned this pull request Jun 15, 2026
20 tasks
mechanicjay pushed a commit to mechanicjay/makeabilitylabwebsite that referenced this pull request Jun 17, 2026
Final step of Track A (makeabilitylab#1253). With the navbar (makeabilitylab#1290), scrollspy (makeabilitylab#1291),
citation popover (makeabilitylab#1292), and carousel (makeabilitylab#1293) all converted to vanilla JS,
nothing in the site's frontend uses jQuery or Bootstrap's JS any longer
(verified: zero `$(...)` calls, zero Bootstrap data-api attributes besides the
inert `data-toggle="popover"` selector). This removes the two now-unused CDN
script tags from base.html:

  - jQuery 1.9.1 (2013; known XSS issues)
  - Bootstrap 3.3.6 JS

Bootstrap's CSS (bootstrap.min.css) stays — only the JavaScript is removed;
the grid/CSS migration is the separate Track B.

Also tidied a now-stale comment in project-sidebar-sticky.js (the rest of the
codebase no longer uses jQuery).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich deleted the 1288-navbar-collapse-vanilla branch June 22, 2026 20:35
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.

1 participant