Created
November 11, 2014 01:52
-
-
Save aarondufall/87eff0f7b1861264d706 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
function setupTabsFor(tableName, initialTabLocation) { | |
$('#' + tableName + '-tabs a').click(function (e) { | |
e.preventDefault() | |
window.location.hash = this.href.split('#', 2)[1]; | |
$(this).tab('show') | |
}) | |
var location = window.location.hash; | |
if(!location) location = '#' + initialTabLocation | |
$('#' + tableName + '-tabs a[href="' + location + '"]').tab('show') | |
$('[data-toggle=tooltip]').tooltip() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment