提交 48db5f1b 编写于 作者: J Johan Preynat

Fix detecting chapters when summary item doesn't contain a link

上级 60b9d41c
......@@ -289,7 +289,15 @@ function preparePage(resetScroll) {
$chapters = $('.book-summary .summary .chapter')
.filter(function() {
var $link = $(this).children('a'),
href = $link.attr('href').split('#')[0];
href = null;
// Chapter doesn't have a link
if (!$link.length) {
return false;
}
else {
href = $link.attr('href').split('#')[0];
}
var resolvedRef = url.resolve(window.location.pathname, href);
return window.location.pathname == resolvedRef;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册