Completely rework the navigation

Get rid of the admin layout
Get rid of the navbar custom style, use bootstrap-sass variables instead
Get rid of all the scaffold files
This commit is contained in:
Henne Vogelsang 2013-06-27 16:58:20 +02:00 committed by Henne Vogelsang
parent 2af8792495
commit 252e1fe544
47 changed files with 179 additions and 252 deletions

View file

@ -90,4 +90,26 @@
}
});
});
$(function() {
// add a hash to the URL when the user clicks on a tab
$('a[data-toggle="tab"]').on('click', function(e) {
history.pushState(null, null, $(this).attr('href'));
});
// navigate to a tab when the history changes
window.addEventListener("popstate", function(e) {
var activeTab = $('[href=' + location.hash + ']');
if (activeTab.length) {
activeTab.tab('show');
} else {
$('.nav-tabs a:first').tab('show');
}
});
});
$(function() {
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
});
<% end %>