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

Select active tab using hash from URL. #203

Closed
JoshMcCullough opened this issue Jul 23, 2013 · 9 comments
Closed

Select active tab using hash from URL. #203

JoshMcCullough opened this issue Jul 23, 2013 · 9 comments
Assignees
Labels
done Done but not yet released request Feature request

Comments

@JoshMcCullough
Copy link

For instance: http://myprinter/#control should show the Control tab by default. I see that there are anchor tags in place for each tab, but they are not pre-selected when the hash changes.

@TTN-
Copy link

TTN- commented Dec 15, 2016

Any word on if there is a commit that has fixed this yet? If there is, I'd be keen to start using it :-)

@Salandora
Copy link
Contributor

No no updates yet, will tackle this one on Sunday.

@eyal0
Copy link
Contributor

eyal0 commented Nov 30, 2017

This is really great! Why isn't it being merged into releases?

@foosel
Copy link
Member

foosel commented Nov 30, 2017

Because it was done against devel. But good point, makes sense to cherry pick this.

@foosel foosel added this to the 1.3.6 milestone Nov 30, 2017
foosel pushed a commit that referenced this issue Nov 30, 2017
foosel added a commit that referenced this issue Nov 30, 2017
foosel added a commit that referenced this issue Nov 30, 2017
@foosel foosel added the done Done but not yet released label Nov 30, 2017
@foosel
Copy link
Member

foosel commented Nov 30, 2017

Cherry picked to maintenance, will be part of 1.3.6.

@eyal0
Copy link
Contributor

eyal0 commented Nov 30, 2017

Would you also consider this change: eyal0@c9b396f

It makes it so that the URL bar updates when clicking on a tab. Here are somethings that I tested and their expected result:

  1. Click on a tab: Tab changes and the URL changes to include the tab's identifier (eg, "#gcode")
  2. Middle-click on tab: New browser window opens with the middle-clicked tab showing.
  3. Copy-paste URL into a new browser window: New window shows the same tab as the previous window.
  4. Click back button: Return to previous website (ie, github), even if lots of tabs have been clicked and the URL has changed a lot.

Number 3 didn't work before c9b396f.

If you want me to make a PR for the above commit (it's only 3 lines) then let me now what branch to do it for and I'll do it.

@foosel
Copy link
Member

foosel commented Nov 30, 2017

Hm... Right with the cherry picking I did follow it up with 3cf694a, intentionally letting the hash changes going to the history because that allows stuff like very quickly toggling back and forth between two tabs through the browser history (and thus something like the side buttons on your run-off-the-mill five button mouse).

Has the same result as your's minus point 4 (again, that's intentional).

@eyal0
Copy link
Contributor

eyal0 commented Nov 30, 2017

Okay. That would be like using pushState instead of replaceState in my example. I read that setting the window.location.hash and using pushState are basically the same so it doesn't matter.

Can't wait to pick it up in the next release! Thanks.

@foosel
Copy link
Member

foosel commented Dec 12, 2017

Closing because 1.3.6 was just released.

@foosel foosel closed this as completed Dec 12, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
done Done but not yet released request Feature request
Projects
None yet
Development

No branches or pull requests

5 participants