first commit
This commit is contained in:
@@ -180,11 +180,17 @@ function createModal({ title, content, onConfirm, confirmText = '确认', cancel
|
||||
</div>
|
||||
</div>`;
|
||||
document.body.appendChild(overlay);
|
||||
document.body.classList.add('modal-open');
|
||||
lucide.createIcons({ elements: [overlay] });
|
||||
|
||||
const close = () => {
|
||||
overlay.classList.remove('open');
|
||||
setTimeout(() => overlay.remove(), 200);
|
||||
setTimeout(() => {
|
||||
overlay.remove();
|
||||
if (!document.querySelector('.modal-overlay')) {
|
||||
document.body.classList.remove('modal-open');
|
||||
}
|
||||
}, 200);
|
||||
};
|
||||
|
||||
overlay.querySelector('.modal-close').addEventListener('click', close);
|
||||
|
||||
Reference in New Issue
Block a user