правка визуальных багов

This commit is contained in:
2026-06-01 00:22:07 +03:00
parent f3a9905423
commit 41fde2566d
14 changed files with 484 additions and 88 deletions

View File

@@ -13,6 +13,7 @@ async function fetchEquipments() {
function renderEquipmentCheckboxes(equipments, containerId, selectTextId, selectedIds = []) {
const container = document.getElementById(containerId);
if (!container) return;
const selected = new Set(selectedIds.map(id => String(id)));
if (!equipments || !equipments.length) {
container.innerHTML = '<p class="text-muted"><small>Оборудование отсутствует</small></p>';
@@ -21,9 +22,10 @@ function renderEquipmentCheckboxes(equipments, containerId, selectTextId, select
}
container.innerHTML = equipments.map(eq => `
<label class="checkbox-container">
<input type="checkbox" value="${eq.id}" ${selectedIds.includes(eq.id) ? 'checked' : ''}>
<span>${escapeHtml(eq.name)}</span>
<label class="checkbox-item">
<input type="checkbox" value="${escapeHtml(eq.id)}" ${selected.has(String(eq.id)) ? 'checked' : ''}>
<span class="checkmark"></span>
<span class="checkbox-label">${escapeHtml(eq.name)}</span>
</label>
`).join('');