Skip to content

Commit

Permalink
修复几个Bug (neo-project#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
陈志同 authored and Celia18305 committed Jul 17, 2019
1 parent 13fab70 commit a7fd766
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions template/css/site.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ nav .logo {
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
}

span::before {
Expand Down Expand Up @@ -74,6 +77,7 @@ nav .logo {
& > nav nav {
display: none;
overflow: hidden;
max-width: 100%;
}

&.show {
Expand Down
9 changes: 6 additions & 3 deletions template/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ $(function () {
});
});
//根据网址自动展开到对应目录
$(function () {
var cachedOnload = window.onload;
window.onload = function () {
cachedOnload();
var pathName = decodeURI(location.pathname);
var link = $(".catalog").find("[href='" + pathName + "']")[0];
$(link).addClass("active");
$(link).parents().show();
$(link).parents("nav").show("fast");
$(link).parents().prev().addClass('expand');
//导航栏高亮
var href = pathName.split('/')[1];
$(".navbar-nav [href='/" + href + "']").each(function () {
$(this).addClass("active");
});
});
};

//懒加载
$(function () {
$('[data-original]').lazyload({
Expand Down
2 changes: 1 addition & 1 deletion template/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</head>
<body data-spy="scroll" data-target="#navbar-sidenav">
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="/"><img class="logo" src="https://neo-cdn.azureedge.net/images/neo-logo/NEO-smart-economy-logo.svg" alt="NEO Logo" /></a>
<a class="navbar-brand" href="https://neo.org"><img class="logo" src="https://neo-cdn.azureedge.net/images/neo-logo/NEO-smart-economy-logo.svg" alt="NEO Logo" /></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down

0 comments on commit a7fd766

Please sign in to comment.