useless css removed. var names improved
This commit is contained in:
parent
ddb8ef223f
commit
45b26747fa
1 changed files with 10 additions and 34 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue