Skip to content

Commit

Permalink
fix jumping to page
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlnc committed Feb 25, 2021
1 parent 0c10a73 commit 9788c33
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ RUN cd /tmp && \
cp splash/*.h /usr/local/include/poppler/splash && \
cd && rm -rf /tmp/poppler

ADD pdf2html-urlnav.patch /pdf2html-urlnav.patch
RUN cd /tmp && \
git clone --depth=1 https://github.com/pdf2htmlEX/pdf2htmlEX.git -b v0.18.7-poppler-0.81.0 && \
cd pdf2htmlEX && \
git apply /pdf2html-urlnav.patch && \
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig && \
mkdir build && \
cd build && \
Expand Down
28 changes: 28 additions & 0 deletions pdf2html-urlnav.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
commit cc678a25e2e7f18e4c3a366f6fa0b1711d79a592
Author: Merlin Chlosta <merlin.chlosta+github@rub.de>
Date: Thu Feb 25 15:08:06 2021 +0100

Fix jumping to page by URL

:100644 100644 a678759 f63b743 M share/pdf2htmlEX.js.in

diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in
index a678759..f63b743 100644
--- a/share/pdf2htmlEX.js.in
+++ b/share/pdf2htmlEX.js.in
@@ -311,13 +311,13 @@ Viewer.prototype = {

if (this.config['hashchange_handler']) {
window.addEventListener('hashchange', function(e) {
- self.navigate_to_dest(document.location.hash.substring(1));
+ self.navigate_to_dest(document.location.hash.substring(1), document.location);
}, false);
}

if (this.config['view_history_handler']) {
window.addEventListener('popstate', function(e) {
- if(e.state) self.navigate_to_dest(e.state);
+ if(e.state) self.navigate_to_dest(e.state, document.location);
}, false);
}

0 comments on commit 9788c33

Please sign in to comment.