修改BUG:配置的菜单与地址可能不一致,导致面包屑导航条多了一个斜杠

This commit is contained in:
Argo-Lenovo 2016-11-19 20:26:01 +08:00
parent 453df71404
commit 702912d1c8
2 changed files with 3 additions and 6 deletions

View File

@ -21,9 +21,7 @@
// breadcrumb
var arch = $('#nav-accordion').find('a.active').last();
var breadcrumb = arch.text();
if (breadcrumb === "") $breadNav.hide();
else $breadNav.text(breadcrumb);
$breadNav.text(arch.text());
var top = arch.offset().top;
if (top > $sidebar.height()) $sidebar.animate({ scrollTop: top + 300 - $sidebar.height() }, 800);

View File

@ -3,9 +3,7 @@
function setActive(ele) {
ele.addClass('active');
ele.parents("ul").first().find('p').addClass('active');
var breadcrumb = ele.text();
if (breadcrumb === "") $breadNav.hide();
else $breadNav.text(breadcrumb);
$breadNav.text(ele.text()).show();
}
$('#navbar').attr('data-toggle', "dropdown").addClass('dropdown-toggle');
var $subMenu = $('#submenu');
@ -19,6 +17,7 @@
setActive($this);
$('iframe').attr('src', $this.attr('href'));
});
$breadNav.hide();
$subMenu.find('a').each(function (index, ele) {
var $this = $(this);
if ($this.attr('href') == window.location.pathname) setActive($this);