1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28:06 +02:00

Move the pdfBug option from the global PDFJS object and into getDocument instead

Also removes the now unused `getDefaultSetting` helper function.
This commit is contained in:
Jonas Jenwald 2018-02-17 23:13:49 +01:00
parent 1d03ad0060
commit 212553840f
7 changed files with 33 additions and 44 deletions

View file

@ -22,8 +22,8 @@ import {
} from './ui_utils';
import {
build, createBlob, getDocument, getFilenameFromUrl, GlobalWorkerOptions,
InvalidPDFException, LinkTarget, MissingPDFException, OPS, PDFJS, PDFWorker,
shadow, UnexpectedResponseException, UNSUPPORTED_FEATURES, version
InvalidPDFException, LinkTarget, MissingPDFException, OPS, PDFWorker, shadow,
UnexpectedResponseException, UNSUPPORTED_FEATURES, version
} from 'pdfjs-lib';
import { CursorTool, PDFCursorTools } from './pdf_cursor_tools';
import { PDFRenderingQueue, RenderingStates } from './pdf_rendering_queue';
@ -306,7 +306,7 @@ let PDFViewerApplication = {
}
}
if ('pdfbug' in hashParams) {
PDFJS.pdfBug = true;
AppOptions.set('pdfBug', true);
let enabled = hashParams['pdfbug'].split(',');
waitOn.push(loadAndEnablePDFBug(enabled));
}
@ -2005,7 +2005,7 @@ function webViewerPageChanging(evt) {
PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(page);
}
// we need to update stats
// We need to update stats.
if (typeof Stats !== 'undefined' && Stats.enabled) {
let pageView = PDFViewerApplication.pdfViewer.getPageView(page - 1);
if (pageView && pageView.stats) {

View file

@ -175,6 +175,11 @@ const defaultOptions = {
value: -1,
kind: OptionKind.API,
},
pdfBug: {
/** @type {boolean} */
value: false,
kind: OptionKind.API,
},
postMessageTransfers: {
/** @type {boolean} */
value: true,