diff --git a/myproject/products/static/products/js/product-search-picker.js b/myproject/products/static/products/js/product-search-picker.js index 375e928..84fd7a0 100644 --- a/myproject/products/static/products/js/product-search-picker.js +++ b/myproject/products/static/products/js/product-search-picker.js @@ -394,9 +394,6 @@ : 'Нет'; var selectedClass = isSelected ? 'selected' : ''; - var checkIcon = isSelected - ? '' - : ''; var photoHtml = product.photo_url ? '' @@ -408,7 +405,6 @@ return '
' + '
' + - checkIcon + '
' + photoHtml + '
' + @@ -483,12 +479,6 @@ if (isSelected) { card.classList.add('selected'); - // Обновить иконку - var icon = card.querySelector('.bi-circle'); - if (icon) { - icon.classList.remove('bi-circle', 'text-muted'); - icon.classList.add('bi-check-circle-fill', 'text-success'); - } // Добавить иконку в grid view если её нет if (this.state.currentView === 'grid') { var posRel = card.querySelector('.position-relative'); @@ -500,17 +490,11 @@ } } else { card.classList.remove('selected'); - var iconCheck = card.querySelector('.bi-check-circle-fill'); - if (iconCheck) { - // В list view меняем иконку - if (this.state.currentView === 'list') { - iconCheck.classList.remove('bi-check-circle-fill', 'text-success'); - iconCheck.classList.add('bi-circle', 'text-muted'); - } else { - // В grid view удаляем иконку - if (iconCheck.classList.contains('check-icon')) { - iconCheck.remove(); - } + // В grid view удаляем иконку + if (this.state.currentView === 'grid') { + var iconCheck = card.querySelector('.check-icon'); + if (iconCheck) { + iconCheck.remove(); } } }