1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28:06 +02:00

Reduce the number of calls to PDFView.getVisiblePages from updateViewarea

This commit is contained in:
Jonas Jenwald 2014-05-09 16:08:19 +02:00
parent 2acb40fffb
commit b88c5330a9

View file

@ -1205,14 +1205,15 @@ var PDFView = {
}
},
renderHighestPriority: function pdfViewRenderHighestPriority() {
renderHighestPriority:
function pdfViewRenderHighestPriority(currentlyVisiblePages) {
if (PDFView.idleTimeout) {
clearTimeout(PDFView.idleTimeout);
PDFView.idleTimeout = null;
}
// Pages have a higher priority than thumbnails, so check them first.
var visiblePages = this.getVisiblePages();
var visiblePages = currentlyVisiblePages || this.getVisiblePages();
var pageView = this.getHighestPriority(visiblePages, this.pages,
this.pageViewScroll.down);
if (pageView) {
@ -1925,7 +1926,7 @@ function updateViewarea() {
return;
}
PDFView.renderHighestPriority();
PDFView.renderHighestPriority(visible);
var currentId = PDFView.page;
var firstPage = visible.first;