useless css removed. var names improved

This commit is contained in:
Mic 2024-12-13 00:18:00 +01:00
parent ddb8ef223f
commit 45b26747fa

View file

@ -155,17 +155,6 @@ switch (message.command) {
--dialog-text-color: #ffffff; --dialog-text-color: #ffffff;
} }
} }
/* Darker overlay for the page background */
.mzta_dialog_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 1000;
}
`; `;
document.head.appendChild(style); document.head.appendChild(style);
@ -233,29 +222,13 @@ switch (message.command) {
--dialog-text-color: #ffffff; --dialog-text-color: #ffffff;
} }
} }
/* Darker overlay for the page background */
.mzta_dialog_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 1000;
}
`; `;
document.head.appendChild(style); document.head.appendChild(style);
function createDialog(inputString, onSubmit) { function createDialog(inputString, onSubmit) {
// Create the overlay
// const overlay = document.createElement('div');
// overlay.className = 'mzta_dialog_overlay';
// document.body.appendChild(overlay);
// Create the dialog // Create the dialog
const dialog = document.createElement('dialog'); const tags_dialog = document.createElement('dialog');
dialog.className = 'mzta_dialog'; tags_dialog.className = 'mzta_dialog';
// Create the content // Create the content
const content = document.createElement('div'); const content = document.createElement('div');
@ -305,15 +278,18 @@ switch (message.command) {
buttonsDiv.appendChild(submitButton); buttonsDiv.appendChild(submitButton);
content.appendChild(form); content.appendChild(form);
dialog.appendChild(content); tags_dialog.appendChild(content);
document.body.appendChild(dialog); document.body.appendChild(tags_dialog);
function closeDialog() { function closeDialog() {
document.body.removeChild(dialog); tags_dialog.close();
document.body.removeChild(overlay); tags_dialog.addEventListener('close', () => {
tags_dialog.remove();
style.remove();
});
} }
dialog.showModal(); tags_dialog.showModal();
} }
// Example usage // Example usage