Commit f5e2d0bc authored by Leigh Stoller's avatar Leigh Stoller

Change tabs when using forward back buttons.

parent 73513547
......@@ -33,6 +33,14 @@ function (_, sup, moment, mainString,
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
window.location.hash = e.target.hash;
});
// Set the correct tab when a user uses their back/forward button
$(window).on('hashchange', function (e) {
var hash = window.location.hash;
if (hash == "") {
hash = "#experiments";
}
$('.nav-tabs a[href='+hash+']').tab('show');
});
LoadUsage();
LoadExperimentTab();
......
......@@ -38,6 +38,14 @@ function (_, sup, moment, mainString,
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
window.location.hash = e.target.hash;
});
// Set the correct tab when a user uses their back/forward button
$(window).on('hashchange', function (e) {
var hash = window.location.hash;
if (hash == "") {
hash = "#experiments";
}
$('.nav-tabs a[href='+hash+']').tab('show');
});
LoadUsage();
LoadExperimentTab();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment