From: notmasteryet Date: Sun, 9 Oct 2011 02:06:14 +0000 (-0500) Subject: Fixing disappearing pages (when multiple are visible) X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=15cbb5a86a8f9340325127cec60241fb965dd251;p=pdf.js.git Fixing disappearing pages (when multiple are visible) --- diff --git a/web/viewer.js b/web/viewer.js index 7e51860..b859505 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -16,6 +16,9 @@ var kMaxScale = 4.0; var Cache = function cacheCache(size) { var data = []; this.push = function cachePush(view) { + var i = data.indexOf(view); + if (i >= 0) + data.splice(i); data.push(view); if (data.length > size) data.shift().update(); @@ -277,7 +280,6 @@ var PDFView = { view: singlePage }); currentHeight += singlePage.height * singlePage.scale + kBottomMargin; } - return visiblePages; } };