]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing disappearing pages (when multiple are visible)
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 9 Oct 2011 02:06:14 +0000 (21:06 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 9 Oct 2011 02:06:14 +0000 (21:06 -0500)
web/viewer.js

index 34a1cf847699a831dd8652f0202e0b076fd1878c..93f6acd315051573e1faa2e7a612aba64ee7cf57 100644 (file)
@@ -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;
   }
 };