提交 295b0bdd 编写于 作者: J Johan Preynat

Use correct chapter when TOC don't contains multiple links

上级 6e62ce5f
......@@ -98,10 +98,17 @@ function setChapterActive($chapter, hash) {
// If hash is provided, set as active chapter
if (!!hash) {
$chapter = $chapters.filter(function() {
var titleId = getChapterHash($(this));
return titleId == hash;
}).first();
// Multiple chapters for this file
if ($chapters.length > 1) {
$chapter = $chapters.filter(function() {
var titleId = getChapterHash($(this));
return titleId == hash;
}).first();
}
// Only one chapter, no need to search
else {
$chapter = $chapters.first();
}
}
// Don't update current chapter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册