Skip to content

Instantly share code, notes, and snippets.

Embed
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 != ""
$("[#{tabSelector}='#{selectedTab}']").click()
@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
You can’t perform that action at this time.