Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

Backports #20093 to the LTS branch.

PR submitted by the release tooling.
[skip ci]

This Pull Request optimizes the functions used in
`/docs/_spec/public/scripts/main.js`.

## Changes made:

1. `currentChapter()` function was simplified using `split()` and
`pop()` instead of `lastIndexOf()` and `substring()`.
2. Used template literals for string interpolation.
3. Simplified the `heading` function by reducing repetitive code and
improving readability.
4. Changed `.removeClass()` and `.addClass()` to `.toggleClass()` for
toggling the class based on condition.
5. General cleanup and optimization for better readability and
performance.
[Cherry-picked 6d29951]
Base automatically changed from lts-20163 to lts-3.3 July 6, 2024 21:54
@WojciechMazur
Copy link
Contributor Author

No regressions detected in the community build up to lts-20279.

Reference

@WojciechMazur WojciechMazur merged commit 1d68d9b into lts-3.3 Jul 6, 2024
@WojciechMazur WojciechMazur deleted the lts-20093 branch July 6, 2024 21:54
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