Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Apr 16, 2023
1 parent 07a9190 commit 0c68d4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
10 changes: 5 additions & 5 deletions public/lib/kookit/kookit.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/containers/panels/progressPanel/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ProgressPanel extends React.Component<
await this.props.htmlBook.rendition.goToChapter(
this.props.htmlBook.flattenChapters[chapterIndex].index.toString(),
this.props.htmlBook.flattenChapters[chapterIndex].href,
""
this.props.htmlBook.flattenChapters[chapterIndex].title
);
}
};
Expand Down
15 changes: 9 additions & 6 deletions src/utils/readUtils/linkUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ export const handleLinkJump = async (event: any, rendition: any = {}) => {
if (!doc) {
return;
}
let chapterInfo = rendition.resolveChapter(href);
rendition.goToChapter(
chapterInfo.index,
chapterInfo.href,
chapterInfo.title
);
if (href.indexOf("/#") === -1) {
let chapterInfo = rendition.resolveChapter(href);
rendition.goToChapter(
chapterInfo.index,
chapterInfo.href,
chapterInfo.title
);
}

let id = href.split("#").reverse()[0];
await rendition.goToNode(doc.body.querySelector("#" + id) || doc.body);
} else if (href && rendition.resolveChapter(href)) {
Expand Down

0 comments on commit 0c68d4e

Please sign in to comment.