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

rustdoc: make expand/collapse all ephemeral #84325

Merged
merged 2 commits into from
Apr 25, 2021

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Apr 19, 2021

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

@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @ollie27

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2021
@rust-log-analyzer

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.
@jsha jsha force-pushed the ephemeral-collapse branch from 8741adf to 39b299f Compare April 19, 2021 05:44
var impl_list = document.getElementById("trait-implementations-list");
if (impl_list !== null) {
onEachLazy(impl_list.getElementsByClassName("collapse-toggle"), function(e) {
collapseNonInherent(e, collapse);
Copy link
Member

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?

var blanket_list = document.getElementById("blanket-implementations-list");
if (blanket_list !== null) {
onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"), function(e) {
collapseNonInherent(e, collapse);
Copy link
Member

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?

Copy link
Contributor Author

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.

@GuillaumeGomez
Copy link
Member

Otherwise looks good to me overall. Applying this logic only on the "hide/show all" wasn't very useful indeed.

@GuillaumeGomez
Copy link
Member

Thanks!

r=me once CI pass

@jsha
Copy link
Contributor Author

jsha commented Apr 25, 2021

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Apr 25, 2021

📌 Commit 9fcfe5e has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2021
@bors
Copy link
Contributor

bors commented Apr 25, 2021

⌛ Testing commit 9fcfe5e with merge 3709ae3...

@bors
Copy link
Contributor

bors commented Apr 25, 2021

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 3709ae3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 25, 2021
@bors bors merged commit 3709ae3 into rust-lang:master Apr 25, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 25, 2021
@jsha jsha deleted the ephemeral-collapse branch April 25, 2021 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: Make expand all / collapse all ephemeral
7 participants