acp breadcrumbs

v1.18.x
psychobunny 10 years ago
parent 4880e2328d
commit 1616b8d3dd

@ -86,6 +86,10 @@
padding-left: 207px;
}
#breadcrumbs {
cursor: default;
}
.wrapper {
width: 100%;
}

@ -23,8 +23,11 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
setupACPSearch();
});
$(window).on('action:ajaxify.end', function() {
$(window).on('action:ajaxify.end', function(ev, data) {
var url = data.url;
setupPills();
selectMenuItem(data.url);
});
setupMainMenu();
@ -41,6 +44,27 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
$('.nano').nanoScroller();
}
function selectMenuItem(url) {
$('#main-menu .nav-list > li').removeClass('active').each(function() {
var menu = $(this),
category = menu.parents('.sidebar-nav'),
href = menu.children('a').attr('href');
if (href && href.slice(1).indexOf(url) !== -1) {
category.addClass('open');
menu.addClass('active');
modifyBreadcrumb(category.find('.nav-header').text(), menu.text());
return false;
}
});
}
function modifyBreadcrumb() {
var caret = ' <i class="fa fa-angle-right"></i> ';
$('#breadcrumbs').html(caret + Array.prototype.slice.call(arguments).join(caret));
}
function setupPills() {
$('.navigation.nav-pills li').removeClass('active');

@ -54,7 +54,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand nodebb-logo" href="{relative_path}/admin/index"><img src="{relative_path}/images/logo.png" alt="NodeBB ACP" /> Admin Control Panel</a>
<a class="navbar-brand nodebb-logo" href="{relative_path}/admin/index"><img src="{relative_path}/images/logo.png" alt="NodeBB ACP" /> Admin Control Panel <span id="breadcrumbs"></span></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">

Loading…
Cancel
Save