-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustdoc: make expand/collapse all ephemeral #84325
Conversation
Some changes occurred in HTML/CSS/JS. |
r? @ollie27 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
The `[+]` in the upper right of a rustdoc page expands or collapses all toggles on the page. That state is stored across page loads, but is used inconsistently. This change explicitly stops storing or using the state.
8741adf
to
39b299f
Compare
src/librustdoc/html/static/main.js
Outdated
var impl_list = document.getElementById("trait-implementations-list"); | ||
if (impl_list !== null) { | ||
onEachLazy(impl_list.getElementsByClassName("collapse-toggle"), function(e) { | ||
collapseNonInherent(e, collapse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this collapse
coming from?
src/librustdoc/html/static/main.js
Outdated
var blanket_list = document.getElementById("blanket-implementations-list"); | ||
if (blanket_list !== null) { | ||
onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"), function(e) { | ||
collapseNonInherent(e, collapse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this collapse
coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting. This was a leftover param that was only true when getSettingValue("collapse") === "true"
. That was never the case, because "collapse"
was the wrong setting name anyhow ("rustdoc-collapse" was the right setting name). Removed it.
Otherwise looks good to me overall. Applying this logic only on the "hide/show all" wasn't very useful indeed. |
Thanks! r=me once CI pass |
@bors r=GuillaumeGomez |
📌 Commit 9fcfe5e has been approved by |
☀️ Test successful - checks-actions |
The
[+]
in the upper right of a rustdoc page expands or collapses all toggles on the page. That state is stored across page loads, but is used inconsistently. This change explicitly stops storing or using the state.This also moves the code for toggling display of trait implementations so that it's near the other toggling code.
Fixes #84318