Created
November 17, 2015 05:26
-
-
Save metalagman/ecc5396fcfd46b5c9778 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$js = <<<JS | |
// Change hash for page-reload | |
$('.nav-tabs a').on('shown.bs.tab', function (e) { | |
window.location.hash = e.target.hash; | |
}) | |
// Javascript to enable link to tab | |
var url = document.location.toString(); | |
if (url.match('#')) { | |
$('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ; | |
} else { | |
$('.nav-tabs a:first').click() ; | |
} | |
JS; | |
$this->registerJs($js); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment