Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created June 19, 2014 20:53
Show Gist options
  • Save workmad3/c67deb08dfa9610e6d77 to your computer and use it in GitHub Desktop.
Save workmad3/c67deb08dfa9610e6d77 to your computer and use it in GitHub Desktop.
hasQueryVariable = (variable)->
query = window.location.search.substring(1)
queryVars = query.split("&")
for queryVar in queryVars
queryKv = queryVar.split("=")
if queryKv[0] == variable
#Return true as soon as we find the variable nam
return true
#Return false if variable name not found
return false
document.addEventListener 'page:fetch', ->
if hasQueryVariable('page')
$("#tabs a[href='#history-tab']").tab('show')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment