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

Merge pull request #14984 from Snuffleupagus/dialog-polyfill-CSS

Bundle the `<dialog>` polyfill-CSS in the GENERIC `legacy/`-viewer (PR 14710 follow-up)
This commit is contained in:
Tim van der Meij 2022-06-05 11:18:18 +02:00 committed by GitHub
commit 37f7995dde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -44,6 +44,15 @@ class OverlayManager {
) {
const dialogPolyfill = require("dialog-polyfill/dist/dialog-polyfill.js");
dialogPolyfill.registerDialog(dialog);
if (!this._dialogPolyfillCSS) {
this._dialogPolyfillCSS = true;
const style = document.createElement("style");
style.textContent = PDFJSDev.eval("DIALOG_POLYFILL_CSS");
document.head.insertBefore(style, document.head.firstElementChild);
}
}
dialog.addEventListener("cancel", evt => {