fix: prevent confirm dialog from closing immediately on delete buttons

This commit is contained in:
infosave2007
2026-01-23 18:57:27 +03:00
parent ea82b78a7d
commit 690881803d
2 changed files with 6 additions and 4 deletions
+4 -1
View File
@@ -453,7 +453,10 @@ document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.btn-uninstall-sp').forEach(btn => {
btn.addEventListener('click', async function(e) {
e.preventDefault();
if (!confirm('Удалить протокол и всех его клиентов?')) return;
e.stopPropagation();
e.stopImmediatePropagation();
const confirmResult = confirm('Удалить протокол и всех его клиентов?');
if (!confirmResult) return;
const slug = btn.getAttribute('data-slug');
const m = document.getElementById('uninstallSpMsg');
m.textContent = '';