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

Current sidebar TOC behaviour on Fog Of Enactment and AI briefing pages makes opening the TOC difficult #13

Open
mrchrisadams opened this issue Sep 16, 2024 · 0 comments

Comments

@mrchrisadams
Copy link
Member

mrchrisadams commented Sep 16, 2024

When I was adding the extra items in the sidebar nav for AI briefing, I realised that it's easy to miss the fact that the sidebar table of contents is expandable.

If you click in the table of text, on the text itself like clicking on "introduction", the browser will jump you straight to the element, similar to how anchor elements work, but it won't open details element, so you won't see the items 'inside' it:

Screenshot 2024-09-16 at 17 33 13

If you click just outside the text then the details element will open, allowing you to see the other elements, like so:

Screenshot 2024-09-16 at 17 37 03

I think previously this was what the addScrollBehaviourToLink() function did - it was designed to toggle the details element if a summary item containing a link was clicked, and then scroll to the place in the page, as opposed to either toggling OR jumping to the anchor part of the page. At this point, the details element is open, so jumping to sub-items is simple enough, and the scrollIntoView ought to have been slow enough for users to realise what just happened.

The code is below:

https://github.com/thegreenwebfoundation/tgwf-2020/blob/master/assets/js/theme.js#L44-L78

I don't think there is any javascript affecting the behaviour of sidebar items now - it appears to be commented out, and I think it might have been quite tightly coupled to the markup of the old theme template.

I don't have a local setup of the wordpress site, and I didn't want to spend time trying to debug it, but I think we might end up doing future reports with this type of template.

So, I'm creating this issue, as it took me a while to understand why the table of contents was acting the way it was, and I suspect I'll forgot by the time we look at it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant