1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Change how the tools are enabled.

This commit is contained in:
Brendan Dahl 2012-02-15 13:13:07 -08:00
parent 0175f53637
commit f54486d8c8
2 changed files with 12 additions and 9 deletions

View file

@ -1122,16 +1122,19 @@ window.addEventListener('load', function webViewerLoad(evt) {
if ('disableTextLayer' in params)
PDFJS.disableTextLayer = (params['disableTextLayer'] === 'true');
if ('PDFBug' in params)
PDFJS.pdfBug = (params['PDFBug'] === 'true');
if (PDFJS.pdfBug) {
if ('pdfBug' in params) {
PDFJS.pdfBug = true;
var pdfBug = params['pdfBug'];
var all = false, enabled = [];
if (pdfBug === 'all')
all = true;
else
enabled = pdfBug.split(',');
var debugTools = PDFBug.tools;
for (var i = 0; i < debugTools.length; ++i) {
var tool = debugTools[i];
var key = 'PDFBug_' + tool.id;
if (key in params)
tool.enabled = (params[key] === 'true');
if (all || enabled.indexOf(tool.id) !== -1)
tool.enabled = true;
}
PDFBug.init();
}