mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Remove the data-pdfjsprinting
attribute on the <body>
when destroying FirefoxPrintService
/PDFPrintService
instances (issue 10948)
Also, cleans up variable definitions slightly in the `FirefoxPrintService.layout` method.
This commit is contained in:
parent
d7afb74a6e
commit
cd48f05597
2 changed files with 13 additions and 6 deletions
|
@ -77,18 +77,21 @@ function FirefoxPrintService(pdfDocument, pagesOverview, printContainer) {
|
|||
|
||||
FirefoxPrintService.prototype = {
|
||||
layout() {
|
||||
let pdfDocument = this.pdfDocument;
|
||||
let printContainer = this.printContainer;
|
||||
let body = document.querySelector('body');
|
||||
const { pdfDocument, pagesOverview, printContainer, } = this;
|
||||
|
||||
const body = document.querySelector('body');
|
||||
body.setAttribute('data-pdfjsprinting', true);
|
||||
|
||||
for (let i = 0, ii = this.pagesOverview.length; i < ii; ++i) {
|
||||
composePage(pdfDocument, i + 1, this.pagesOverview[i], printContainer);
|
||||
for (let i = 0, ii = pagesOverview.length; i < ii; ++i) {
|
||||
composePage(pdfDocument, i + 1, pagesOverview[i], printContainer);
|
||||
}
|
||||
},
|
||||
|
||||
destroy() {
|
||||
this.printContainer.textContent = '';
|
||||
|
||||
const body = document.querySelector('body');
|
||||
body.removeAttribute('data-pdfjsprinting');
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue