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

Clicking sidebar toggle returns page to top. #5

Closed
c-forster opened this issue Jan 27, 2016 · 3 comments
Closed

Clicking sidebar toggle returns page to top. #5

c-forster opened this issue Jan 27, 2016 · 3 comments

Comments

@c-forster
Copy link

On a long text, clicking the sidebar toggle jumps the page back to the top and loses your place. (For a long text, with a table of contents, I was interested to see if the ToC would appear int he sidebar.)

@elotroalex
Copy link
Owner

Hmm. I can't reproduce it here. Getting the ToC of the long text could be achieved by putting in a liquid for loop (or manually) on the sidebar.html in _includes. But this would be assuming that you want the whole site to show that in the sidebar. To do page specific ToC on the sidebar, would require a bit of javascript and deeper tweaking of sidebar.html. Be happy to take a pull request if you think this is a feature many people will like.

@elotroalex
Copy link
Owner

@c-forster, could you tell me what your conditions are? Is this Chrome? How long is the text?

@c-forster
Copy link
Author

So, if I go to the fifth chapter of The Narrative of the Life of Frederick Douglas, and then toggle the sidebar, I lose my place (the page jumps to the top). This is on both Chrome (47.0.2526.80) and Firefox (41.0.1) on OS X 10.10.05.

I did a little more digging and this behavior has been reported as an issue on the lanyon page: poole/lanyon#137

That issue features a fix that appears to work, though I haven't been able to test it thoroughly to make sure it doesn't break something else (I'd be particularly worried about mobile). I'm not sure why there hasn't been a fix/PR on Lanyon. I'll submit a pull request here that would use the simple fix described there; but be wary of accepting it without testing on mobile to make sure.

elotroalex added a commit that referenced this issue Jan 28, 2016
Fixes issue #5, page jumping to top when sidebar toggled.
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

2 participants