]> 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)
committerJulian Viereck <julian.viereck@gmail.com>
Tue, 11 Oct 2011 20:07:55 +0000 (22:07 +0200)
web/viewer.js

index 7e5186073a0d743d45051e25d001a9bfc3384b97..b85950548defbb3a730769f9639a5a19d2b84040 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;
   }
 };