Skip to content

GitHub table of contents position issue when viewport is resized #102

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

Closed
mxmilkiib opened this issue Sep 1, 2019 · 9 comments
Closed

GitHub table of contents position issue when viewport is resized #102

mxmilkiib opened this issue Sep 1, 2019 · 9 comments

Comments

@mxmilkiib
Copy link

I'm using the TreeStyleTabs addon sidebar. When I toggle the sidebar off, the position of the ToC doesn't change. This is also the case when the whole window is resized.

@Mottie
Copy link
Owner

Mottie commented Sep 2, 2019

Hi @mxmilkb!

I'm guessing you mean this Firefox addon? I'm not sure what you mean by the position of the TOC not changing. If it ever goes off screen you can reset it using the g, then r hot keys.

The popup is draggable, and it's position is set from the left side of the window. Do you think if we saved the distance from the right edge of the window that it would behave more as you would expect?

@mxmilkiib
Copy link
Author

Yes. As in, when the viewport width increases, the menu then overlaps part of the central content.

Thanks for the tip! I've remapped these to c+i and c+a so as to avoid keys used by Vimium or Github. This changes the molehill of a problem from a minor practical issue to an aesthetic one :)

Indeed, I was wondering if there was a way to have it position itself relative to the edge of the central content.

@Mottie
Copy link
Owner

Mottie commented Sep 2, 2019

Please try out the latest version. You'll likely have to reset the popup, but now it will maintain it's position based on the middle of the screen. That was a great idea! Thanks!

@mxmilkiib
Copy link
Author

That's great, thanks!

The title of the popup does say 'null' though.

Aside; when I restore the popup, it's position moves to just below the header, rather than the default position.

@Mottie
Copy link
Owner

Mottie commented Sep 2, 2019

The title can be modified through the Tampermonkey settings.

Yeah, I made the default/reset position of the popup to be in the upper right under the header. Move as desired.

@mxmilkiib
Copy link
Author

title: "Table of Contents", was already set at the top of the script.

I selected the Tampermonkey menu item "Set Table of Content Title", then entered "Table of Contents", and I got this;

image

@Mottie Mottie reopened this Sep 3, 2019
@mxmilkiib
Copy link
Author

mxmilkiib commented Sep 3, 2019

Hmm, it appears to have ironed itself out now, I'm just seeing "Table of Contents" as the title now. I had thought I'd done a hard reload before..

@Mottie
Copy link
Owner

Mottie commented Sep 3, 2019

I was able to duplicate the issue... I'll investigate soon.

@Mottie
Copy link
Owner

Mottie commented Sep 6, 2019

Ok, all fixed now! 🎉

@Mottie Mottie closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants