Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Reload the last selected tab based on the window hash
$.fn.rememberSelectedTab = (tabSelector = "aria_controls")->
selectedTab = window.location.hash.replace "#", ""
if selectedTab && selectedTab != ""
@each ->
$(@).find("ul.nav-tabs li").click ->
name = $(@).find("a").attr tabSelector
window.location.hash = name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment