-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix toc_controller bug in reader.js converting nav/ncx rel paths to o…
…pf rel
- Loading branch information
1 parent
ff466a6
commit 8cf514b
Showing
7 changed files
with
32 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- reader/js/reader.js.orig 2021-06-08 09:45:16.000000000 -0400 | ||
+++ reader/js/reader.js 2021-06-08 09:51:48.000000000 -0400 | ||
@@ -4310,7 +4310,11 @@ | ||
|
||
$list.append(docfrag); | ||
$list.find(".toc_link").on("click", function(event){ | ||
- var url = this.getAttribute('href'); | ||
+ // convert href to be relative to the opf not ncx or nav | ||
+ var ahref = this.getAttribute('href'); | ||
+ var basePath = book.packaging.navPath || book.packaging.ncxPath | ||
+ var base = 'https://example.invalid/' | ||
+ var url = new URL(ahref, base + basePath).href.replace(base, '') | ||
|
||
event.preventDefault(); | ||
|
||
@@ -4344,4 +4348,4 @@ | ||
}; | ||
}; | ||
|
||
-//# sourceMappingURL=reader.js.map | ||
\ No newline at end of file | ||
+//# sourceMappingURL=reader.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.