Convert the existing overlays to use <dialog> elements (issue 14698)

This replaces our *custom* overlays with standard `<dialog>` DOM elements, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog, thus simplifying the related CSS, HTML, and JavaScript code.

With these changes, some of the functionality of the `OverlayManager` class is now handled natively (e.g. `Esc` to close the dialog). However, since we still need to be able to prevent dialogs from overlaying one another, it still makes sense to keep this functionality (as far as I'm concerned).
This commit is contained in:
Jonas Jenwald 2022-03-25 14:10:13 +01:00
parent 0dd6bc9a85
commit f0aa08b464
9 changed files with 221 additions and 272 deletions

View file

@ -161,16 +161,16 @@ function getViewerConfiguration() {
findNextButton: document.getElementById("findNext"),
},
passwordOverlay: {
overlayName: "passwordOverlay",
container: document.getElementById("passwordOverlay"),
dialogName: "passwordDialog",
dialog: document.getElementById("passwordDialog"),
label: document.getElementById("passwordText"),
input: document.getElementById("password"),
submitButton: document.getElementById("passwordSubmit"),
cancelButton: document.getElementById("passwordCancel"),
},
documentProperties: {
overlayName: "documentPropertiesOverlay",
container: document.getElementById("documentPropertiesOverlay"),
dialogName: "documentPropertiesDialog",
dialog: document.getElementById("documentPropertiesDialog"),
closeButton: document.getElementById("documentPropertiesClose"),
fields: {
fileName: document.getElementById("fileNameField"),