Skip to content

Draft: Remove jQuery dependency from dom.js

Sarah German requested to merge jquery-domjs into main

What does this MR do and why?

Removes jQuery calls from dom.js, a helper script that provides a few DOM-related utilities.

jQuery was only used here for getting the outer height of the collapsible_container component (used for the table of contents on small-width devices). It's now a lot easier to get the outer height of elements without jQuery: https://youmightnotneedjquery.com/#outer_height

One step towards closing #1682 (closed) 🚶

Screenshots, screen recordings, or links to review app

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Size your window down below the XL breakpoint, where the mobile nav kicks in
  3. Verify you can expand and collapse the table of contents component (the list of items under "on this page")

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah German

Merge request reports