Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
send num pages when fetching links
Browse files Browse the repository at this point in the history
  • Loading branch information
fonol committed Aug 21, 2020
1 parent b767d6b commit a390543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions web/dist/siac.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,7 @@ window.rerenderPDFPage = function(num, shouldScrollUp = true, fitToPage = false,
}
}
if (fetchHighlights && pageSidebarDisplayed) {
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
}
}
}).catch(function (err) { setTimeout(function () { console.log(err); }); });
Expand Down Expand Up @@ -3147,7 +3147,7 @@ window.togglePageSidebar = function(persist = true) {
if (pageSidebarDisplayed) {
$('#siac-reading-modal-center').addClass('siac-page-sidebar');
if (persist)
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
} else {
$('#siac-reading-modal-center').removeClass('siac-page-sidebar');
}
Expand All @@ -3158,7 +3158,7 @@ window.togglePageSidebar = function(persist = true) {
}
window.updatePageSidebarIfShown = function() {
if (pdfDisplayed && pageSidebarDisplayed) {
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
}
}

Expand Down
6 changes: 3 additions & 3 deletions web/src/pdf_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ window.rerenderPDFPage = function(num, shouldScrollUp = true, fitToPage = false,
}
}
if (fetchHighlights && pageSidebarDisplayed) {
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
}
}
}).catch(function (err) { setTimeout(function () { console.log(err); }); });
Expand Down Expand Up @@ -1066,7 +1066,7 @@ window.togglePageSidebar = function(persist = true) {
if (pageSidebarDisplayed) {
$('#siac-reading-modal-center').addClass('siac-page-sidebar');
if (persist)
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
} else {
$('#siac-reading-modal-center').removeClass('siac-page-sidebar');
}
Expand All @@ -1077,7 +1077,7 @@ window.togglePageSidebar = function(persist = true) {
}
window.updatePageSidebarIfShown = function() {
if (pdfDisplayed && pageSidebarDisplayed) {
pycmd("siac-linked-to-page " + pdfDisplayedCurrentPage);
pycmd(`siac-linked-to-page ${pdfDisplayedCurrentPage} ${pdfDisplayed.numPages}`);
}
}

Expand Down

0 comments on commit a390543

Please sign in to comment.