Created
June 19, 2014 20:53
-
-
Save workmad3/c67deb08dfa9610e6d77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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