Created
October 3, 2016 03:19
-
-
Save albb0920/168b1ac97b90d863312997fa5ca4d379 to your computer and use it in GitHub Desktop.
bootstrap tab thing
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
$('#settings-tabs a[data-target]').click (e)-> | |
e.stopPropagation() | |
e.preventDefault() | |
history.pushState(null, null, $(this).attr('href')) | |
$('#settings-tabs .active').removeClass('active') | |
$(this).closest('li').addClass('active') | |
active_pane = $($(this).data('target')) | |
active_pane.closest('.tab-content').find('.tab-pane.active').removeClass('active') | |
active_pane.addClass('active') | |
if tab = URI.parseQuery(URI().query())['tab'] | |
$("#settings-tabs a[data-target=\"##{tab}\"]").click() | |
else | |
$('#settings-tabs a[data-target]').first().click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment