This commit is contained in:
Tomas Dvorak
2025-05-30 12:13:50 +02:00
parent 363e8bc5bc
commit 9353aabcab
+4 -5
View File
@@ -2190,25 +2190,25 @@ function openAddAppModal() {
// Select an icon // Select an icon
function selectIcon(iconClass) { function selectIcon(iconClass) {
const iconInput = document.getElementById('appIcon'); const iconInput = document.getElementById('appIcon');
const selectedIcon = document.getElementById('selectedIcon');
const iconPreview = document.getElementById('iconPreview'); const iconPreview = document.getElementById('iconPreview');
const customIconPreview = document.getElementById('customIconPreview');
const iconClassInput = document.getElementById('appIconClass'); const iconClassInput = document.getElementById('appIconClass');
const iconPickerModal = document.getElementById('iconPickerModal'); const iconPickerModal = document.getElementById('iconPickerModal');
if (iconInput && selectedIcon && iconClassInput) {
// Hide any custom icon preview // Hide any custom icon preview
const customIconPreview = document.getElementById('customIconPreview');
if (customIconPreview) { if (customIconPreview) {
customIconPreview.classList.add('hidden'); customIconPreview.classList.add('hidden');
customIconPreview.src = ''; customIconPreview.src = '';
} }
// Show the Font Awesome icon // Show the Font Awesome icon
const selectedIcon = document.getElementById('selectedIcon');
if (selectedIcon) { if (selectedIcon) {
selectedIcon.className = `fas ${iconClass} text-2xl text-blue-600`; selectedIcon.className = `fas ${iconClass} text-2xl text-blue-600`;
selectedIcon.classList.remove('hidden'); selectedIcon.classList.remove('hidden');
} }
if (iconInput && selectedIcon && iconClassInput) {
// Update the hidden input with the icon class // Update the hidden input with the icon class
iconClassInput.value = iconClass; iconClassInput.value = iconClass;
@@ -2239,8 +2239,7 @@ function selectIcon(iconClass) {
iconPreview.className = 'w-12 h-12 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-3'; iconPreview.className = 'w-12 h-12 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-3';
} }
} }
} } }
// Reset icon selection // Reset icon selection
const appIcon = document.getElementById('appIcon'); const appIcon = document.getElementById('appIcon');
const customIconInput = document.getElementById('customIconInput'); const customIconInput = document.getElementById('customIconInput');