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

Adding an option to use replaceState() method instead of pushState() #21

Closed hmemcpy closed 3 years ago

hmemcpy commented 8 years ago

The excellent plugin uses pushState() in order to change the URL on every tab press, creating a deep link to the tab. This, however, causes every tab change to be added to navigation history.

This PR adds an option to use replaceState() method instead, so the URL is changed, but the history is not written, allowing the back button to go to the previous page.

This fixes #20.

demiankatz commented 4 years ago

This would be really helpful for my use case as well; any chance of this getting merged? Thanks!

demiankatz commented 4 years ago

Actually, this PR didn't quite work for me as-is, so I adapted it here: https://github.com/demiankatz/Geeby-Deeby/blob/57247f5acfc118ea6c0e742055e9149a0b7b30a0/public/js/vendor/jquery.stickytabs.js