|
|
@ -37,10 +37,6 @@ var RenderingQueue = (function RenderingQueueClosure() { |
|
|
|
if (!item.drawingRequired()) |
|
|
|
if (!item.drawingRequired()) |
|
|
|
return; // as no redraw required, no need for queueing.
|
|
|
|
return; // as no redraw required, no need for queueing.
|
|
|
|
|
|
|
|
|
|
|
|
if ('rendering' in item) |
|
|
|
|
|
|
|
return; // is already in the queue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
item.rendering = true; |
|
|
|
|
|
|
|
this.items.push(item); |
|
|
|
this.items.push(item); |
|
|
|
if (this.items.length > 1) |
|
|
|
if (this.items.length > 1) |
|
|
|
return; // not first item
|
|
|
|
return; // not first item
|
|
|
@ -49,7 +45,6 @@ var RenderingQueue = (function RenderingQueueClosure() { |
|
|
|
}, |
|
|
|
}, |
|
|
|
continueExecution: function RenderingQueueContinueExecution() { |
|
|
|
continueExecution: function RenderingQueueContinueExecution() { |
|
|
|
var item = this.items.shift(); |
|
|
|
var item = this.items.shift(); |
|
|
|
delete item.rendering; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.items.length == 0) |
|
|
|
if (this.items.length == 0) |
|
|
|
return; // queue is empty
|
|
|
|
return; // queue is empty
|
|
|
@ -869,7 +864,10 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
stats.begin = Date.now(); |
|
|
|
stats.begin = Date.now(); |
|
|
|
this.content.startRendering(ctx, function pageViewDrawCallback(error) { |
|
|
|
this.content.startRendering(ctx, function pageViewDrawCallback(error) { |
|
|
|
div.removeChild(self.loadingIconDiv); |
|
|
|
if (self.loadingIconDiv) { |
|
|
|
|
|
|
|
div.removeChild(self.loadingIconDiv); |
|
|
|
|
|
|
|
delete self.loadingIconDiv; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (error) |
|
|
|
if (error) |
|
|
|
PDFView.error('An error occurred while rendering the page.', error); |
|
|
|
PDFView.error('An error occurred while rendering the page.', error); |
|
|
@ -969,7 +967,7 @@ var ThumbnailView = function thumbnailView(container, page, id, pageRatio) { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.setImage = function thumbnailViewSetImage(img) { |
|
|
|
this.setImage = function thumbnailViewSetImage(img) { |
|
|
|
if (this.hasImage) |
|
|
|
if (this.hasImage || !img) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
var ctx = getPageDrawContext(); |
|
|
|
var ctx = getPageDrawContext(); |
|
|
@ -1207,7 +1205,6 @@ window.addEventListener('scroll', function webViewerScroll(evt) { |
|
|
|
updateViewarea(); |
|
|
|
updateViewarea(); |
|
|
|
}, true); |
|
|
|
}, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var thumbnailTimer; |
|
|
|
var thumbnailTimer; |
|
|
|
|
|
|
|
|
|
|
|
function updateThumbViewArea() { |
|
|
|
function updateThumbViewArea() { |
|
|
|