8000 Rollup of 4 pull requests by GuillaumeGomez · Pull Request #118975 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 4 pull requests #118975

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

Merged
merged 19 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0983438
rustdoc: allow resizing the sidebar
notriddle Sep 8, 2023
210c88f
rustdoc: clean up main.js and src-script.js
notriddle Sep 26, 2023
273a302
rustdoc: enforce BODY_MIN constraint on sidebar resize
notriddle Sep 27, 2023
9aabfd5
rustdoc: bundle sidebar button icon into CSS
notriddle Oct 7, 2023
77fa09d
rustdoc: avoid whole page layout on each frame
notriddle Oct 7, 2023
fd9f1a7
rustdoc: fix resize trouble with mobile
notriddle Oct 11, 2023
14ed92c
Don't merge cfg and doc(cfg) attributes for re-exports
GuillaumeGomez Jun 26, 2023
7953d5d
Add regression test for cfg merging on re-exports
GuillaumeGomez Jun 27, 2023
0ccd5c4
Update existing tests
GuillaumeGomez Jun 28, 2023
823148f
Add documentation on `filter_doc_attr`
GuillaumeGomez Jun 28, 2023
07e6224
Extract casting detection logic in it's own function
Urgau Dec 12, 2023
97a2613
Refactor and rename some functions in ref casting lint
Urgau Dec 12, 2023
4839cca
Recurse into let bindings if possible in ref casting lint
Urgau Dec 12, 2023
4287f5a
rustc_mir_build: Make non-exhaustive non-empty match diagnotics deter…
Enselic Dec 14, 2023
5644a53
rustc_mir_build: Enforce `rustc::potential_query_instability` lint
Enselic Dec 14, 2023
ec0008a
Rollup merge of #113091 - GuillaumeGomez:prevent-cfg-merge-reexport, …
GuillaumeGomez Dec 15, 2023
f8b9269
Rollup merge of #115660 - notriddle:notriddle/sidebar-resize, r=Guill…
GuillaumeGomez Dec 15, 2023
d3d0287
Rollup merge of #118863 - Enselic:rustc_mir-build-query-stability, r=…
GuillaumeGomez Dec 15, 2023
25216b6
Rollup merge of #118909 - Urgau:cleanup-improvement-invalid_ref_casti…
GuillaumeGomez Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc: clean up main.js and src-script.js
* Run the querySelector for the toggleLabel only once, and store
  the result.
* Use querySelector to find the resizer and sidebar.
* Add comments to main.js sections.
  • Loading branch information
notriddle committed Oct 11, 2023
commit 210c88fc7ae55df147b45b9e75f95874c1a589ef
6 changes: 4 additions & 2 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
searchState.setup();
}());

// This section handles sidebar resizing
(function() {
const sidebarButton = document.getElementById("sidebar-button");
if (sidebarButton) {
Expand All @@ -1283,8 +1284,8 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
});
}
let currentPointerId = null;
const resizer = document.getElementsByClassName("sidebar-resizer")[0];
const sidebar = document.getElementsByClassName("sidebar")[0];
const resizer = document.querySelector(".sidebar-resizer");
const sidebar = document.querySelector(".sidebar");
if (!resizer || !sidebar) {
return;
}
Expand Down Expand Up @@ -1379,6 +1380,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
resizer.addEventListener("pointerdown", initResize, false);
}());

// This section handles the copy button that appears next to the path breadcrumbs
(function() {
let reset_button_timeout = null;

Expand Down
13 changes: 9 additions & 4 deletions src/librustdoc/html/static/js/src-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,22 @@ function createDirEntry(elem, parent, fullPath, hasFoundFile) {
return hasFoundFile;
}

let toggleLabel;

function getToggleLabel() {
toggleLabel = toggleLabel || document.querySelector("#src-sidebar-toggle button");
return toggleLabel;
}

window.rustdocCloseSourceSidebar = () => {
const toggleLabel = document.querySelector("#src-sidebar-toggle button");
removeClass(document.documentElement, "src-sidebar-expanded");
toggleLabel.innerText = ">";
getToggleLabel().innerText = ">";
updateLocalStorage("source-sidebar-show", "false");
};

window.rustdocShowSourceSidebar = () => {
const toggleLabel = document.querySelector("#src-sidebar-toggle button");
addClass(document.documentElement, "src-sidebar-expanded");
toggleLabel.innerText = "<";
getToggleLabel().innerText = "<";
updateLocalStorage("source-sidebar-show", "true");
};

Expand Down
0