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

ToC non-functional with Javascript disabled #2013

Closed
lurch opened this issue Aug 10, 2021 · 3 comments · Fixed by #2154
Closed

ToC non-functional with Javascript disabled #2013

lurch opened this issue Aug 10, 2021 · 3 comments · Fixed by #2154
Assignees
Labels
needs discussion toolchain This is an infrastructure/toolchain issue

Comments

@lurch
Copy link
Contributor

lurch commented Aug 10, 2021

In #1935 @Gadgetoid complains that the new site is "a little bit completely broken without Javascript" which I was kinda surprised by.
So I gave it a try myself with JS turned off, and it seems that https://www.raspberrypi.org/documentation/ works okay (with the exception of the search box, because that's entirely implemented by javascript), https://www.raspberrypi.org/documentation/accessories/ works okay, and the contents of e.g. https://www.raspberrypi.org/documentation/accessories/display.html works okay.
AFAICT it seems that the only bit that doesn't work is the exapanding and collapsing of sections in the Table of Contents on the left? Perhaps we should tweak things so that if JS is disabled, the ToC is fully-expanded rather than being fully-collapsed?

@lurch lurch added toolchain This is an infrastructure/toolchain issue needs discussion labels Aug 10, 2021
@aallan
Copy link
Contributor

aallan commented Aug 10, 2021

Thoughts @nelliemckesson ?

@Gadgetoid
Copy link
Contributor

FWIW the page I landed on was this - https://www.raspberrypi.org/documentation/computers/configuration.html

And the left-hand navigation looked "complete" ish (I wasn't aware of the drop down menu at this point) but clicking the links did nothing so it felt like I'd been dropped on a looooonnng page with now way to navigate it. Yes... I'm the kind of difficult pedant who browses the web with javascript disabled by default.

As @lurch suggests, I'd recommend a "progressive enhancement" approach whereupon the submenus are always enabled - ie: not hidden by default with the CSS - and only hidden by javascript at runtime. This usually happens fast enough that you don't get a surprising flash of expanded menus.

style.css line ~207 shows these submenu items require a "hidden" class in order to be hidden, so just removing that from the HTML and adding it at runtime with JS would suffice:

nav#contents .itemcontents.hidden,
nav#mobile-contents .contents-inner.hidden {
  height: 0px;
  overflow: hidden;
}

(Granted the main thrust of web development experience is at least 5 years out of date so I could be spouting nonsense.)

@lurch
Copy link
Contributor Author

lurch commented Sep 15, 2021

ping @Gadgetoid The fix for this is now live at https://www.raspberrypi.org/documentation/ 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion toolchain This is an infrastructure/toolchain issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants