Limit some PDFRenderingQueue
-related code to the GENERIC viewer
Given that this functionality is only relevant in third-party use-cases, for example the viewer-components, we can avoid needlessly including it in e.g. the MOZCENTRAL build.
This commit is contained in:
parent
071e6bc7e7
commit
e8c727742c
@ -36,6 +36,12 @@ class PDFRenderingQueue {
|
|||||||
this.idleTimeout = null;
|
this.idleTimeout = null;
|
||||||
this.printing = false;
|
this.printing = false;
|
||||||
this.isThumbnailViewEnabled = false;
|
this.isThumbnailViewEnabled = false;
|
||||||
|
|
||||||
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
|
Object.defineProperty(this, "hasViewer", {
|
||||||
|
value: () => !!this.pdfViewer,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,13 +66,6 @@ class PDFRenderingQueue {
|
|||||||
return this.highestPriorityPage === view.renderingId;
|
return this.highestPriorityPage === view.renderingId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
hasViewer() {
|
|
||||||
return !!this.pdfViewer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} currentlyVisiblePages
|
* @param {Object} currentlyVisiblePages
|
||||||
*/
|
*/
|
||||||
|
@ -301,7 +301,10 @@ class PDFViewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.defaultRenderingQueue = !options.renderingQueue;
|
this.defaultRenderingQueue = !options.renderingQueue;
|
||||||
if (this.defaultRenderingQueue) {
|
if (
|
||||||
|
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
|
||||||
|
this.defaultRenderingQueue
|
||||||
|
) {
|
||||||
// Custom rendering queue is not specified, using default one
|
// Custom rendering queue is not specified, using default one
|
||||||
this.renderingQueue = new PDFRenderingQueue();
|
this.renderingQueue = new PDFRenderingQueue();
|
||||||
this.renderingQueue.setViewer(this);
|
this.renderingQueue.setViewer(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user