aidanlister / jquery-stickytabs

Provides persistant state (back and forward button support) for Bootstrap tabs
http://aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/
MIT License
60 stars 33 forks source link

Use 'replaceState' instead of 'pushState' in order to keep the back button working #20

Open hmemcpy opened 8 years ago

hmemcpy commented 8 years ago

Great plugin! We're using it in our documentation site, mainly to support deep linking into a specific tab.

I wonder if it would be better to use replaceState instead, in order not to keep the old url in the history? If switching several times between tabs, each switch will be remembered by the back button...

I ran a little test here, and it seems that everything still works with replaceState. Any reason not to use it? Would you accept a PR with adding this to the options?

aidanlister commented 8 years ago

Maybe it could be a toggle ... for deep linking behaviour it makes sense that every navigation can be back/forwarded.

hmemcpy commented 8 years ago

Just sent a PR. Please let me know what you think?