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

Scroll left toc to active entry #1023

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fekete-robert
Copy link
Collaborator

Useful when the left-side toc is longer than the screen.
Fixes #348 and #257

This is an update of the original patch of narrenfrei

Notes:

Useful when the left-side toc is longer than the screen.
Fixes google#348 and google#257

This is an update of the original patch of narrenfrei
@google-cla
Copy link

google-cla bot commented May 25, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@LisaFC
Copy link
Collaborator

LisaFC commented May 30, 2022

@narrenfrei do you want to take a look at this?

@fekete-robert
Copy link
Collaborator Author

Hi @LisaFC and @narrenfrei, have you had a chance to review this PR?

@raum51
Copy link
Contributor

raum51 commented Sep 13, 2022

I think in the netlify preview the functionality doesn't work, because the sample page ist built with the cached sidebar sidebar_cache_limit: 10.

Also the script that adapts the sidebar menu when the sidebar cache is use have to set the id of the span to td-sidebar-nav-active-item. Actually only a class get added.

$("#td-section-nav #{{ $mid }}-li span").addClass("td-sidebar-nav-active-item");

@fekete-robert
Copy link
Collaborator Author

Many thanks for the comments, I'll try to fix them later this week

@fekete-robert
Copy link
Collaborator Author

@raum51 : I've added a line to add the id to the span, but if the cache limit is low, the scrolling doesn't work for some reason. Any ideas?

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

Successfully merging this pull request may close these issues.

Left-side menu / TOC jumps around after you click a menu
3 participants