1
Fork 0

Improve click behavior of the source code mobile full-screen "sidebar"

On desktop, if you open the source code sidebar, it stays open even when you
move from page to page. It used to do the same thing on mobile, but I think
that's stupid. Since the file list fills the entire screen on mobile, and you
can't really do anything with the currently selected file other than dismiss
the "sidebar" to look at it, it's safe to assume that anybody who clicks a
file in that list probably wants the list to go away so they can see it.
This commit is contained in:
Michael Howell 2022-07-01 12:13:46 -07:00
parent 5b9775fe17
commit 83f22885ae
4 changed files with 46 additions and 2 deletions

View file

@ -9,6 +9,11 @@ const darkThemes = ["dark", "ayu"];
window.currentTheme = document.getElementById("themeStyle");
window.mainTheme = document.getElementById("mainThemeStyle");
// WARNING: RUSTDOC_MOBILE_BREAKPOINT MEDIA QUERY
// If you update this line, then you also need to update the two media queries with the same
// warning in rustdoc.css
window.RUSTDOC_MOBILE_BREAKPOINT = 701;
const settingsDataset = (function() {
const settingsElement = document.getElementById("default-settings");
if (settingsElement === null) {