mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 04:22:58 +00:00
f
This commit is contained in:
@@ -2302,6 +2302,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
// Add click handler for custom icon button
|
// Add click handler for custom icon button
|
||||||
const customIconBtn = document.getElementById('customIconBtn');
|
const customIconBtn = document.getElementById('customIconBtn');
|
||||||
const customIconInput = document.getElementById('customIconInput');
|
const customIconInput = document.getElementById('customIconInput');
|
||||||
|
|
||||||
if (customIconBtn && customIconInput) {
|
if (customIconBtn && customIconInput) {
|
||||||
customIconBtn.addEventListener('click', function(e) {
|
customIconBtn.addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -2309,6 +2310,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Color picker setup
|
||||||
const appColor = document.getElementById('appColor');
|
const appColor = document.getElementById('appColor');
|
||||||
const appColorText = document.getElementById('appColorText');
|
const appColorText = document.getElementById('appColorText');
|
||||||
|
|
||||||
@@ -2528,10 +2530,12 @@ function renderIcons(searchTerm) {
|
|||||||
|
|
||||||
// Select an icon
|
// Select an icon
|
||||||
function selectIcon(iconClass) {
|
function selectIcon(iconClass) {
|
||||||
|
const iconPickerModal = document.getElementById('iconPickerModal');
|
||||||
const selectedIcon = document.getElementById('selectedIcon');
|
const selectedIcon = document.getElementById('selectedIcon');
|
||||||
const customIconPreview = document.getElementById('customIconPreview');
|
const customIconPreview = document.getElementById('customIconPreview');
|
||||||
const iconPreview = document.getElementById('iconPreview');
|
const iconPreview = document.getElementById('iconPreview');
|
||||||
const appIcon = document.getElementById('appIcon');
|
const appIcon = document.getElementById('appIcon');
|
||||||
|
const iconClassInput = document.getElementById('appIconClass');
|
||||||
|
|
||||||
// Show the selected icon and hide custom icon preview
|
// Show the selected icon and hide custom icon preview
|
||||||
if (selectedIcon) {
|
if (selectedIcon) {
|
||||||
@@ -2545,6 +2549,7 @@ function selectIcon(iconClass) {
|
|||||||
|
|
||||||
// Set the app icon value to the selected icon class
|
// Set the app icon value to the selected icon class
|
||||||
if (appIcon) appIcon.value = iconClass;
|
if (appIcon) appIcon.value = iconClass;
|
||||||
|
if (iconClassInput) iconClassInput.value = iconClass;
|
||||||
|
|
||||||
// Reset file input
|
// Reset file input
|
||||||
const customIconInput = document.getElementById('customIconInput');
|
const customIconInput = document.getElementById('customIconInput');
|
||||||
@@ -2556,6 +2561,23 @@ function selectIcon(iconClass) {
|
|||||||
if (iconPreview) {
|
if (iconPreview) {
|
||||||
iconPreview.className = `mt-2 flex items-center justify-center w-16 h-16 bg-${randomColor}-100 rounded-md overflow-hidden`;
|
iconPreview.className = `mt-2 flex items-center justify-center w-16 h-16 bg-${randomColor}-100 rounded-md overflow-hidden`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close the modal
|
||||||
|
if (iconPickerModal) {
|
||||||
|
iconPickerModal.classList.add('hidden');
|
||||||
|
isModalOpen = false;
|
||||||
|
document.body.style.overflow = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove active class from all icons
|
||||||
|
document.querySelectorAll('.icon-option').forEach(option => {
|
||||||
|
option.classList.remove('active');
|
||||||
|
});
|
||||||
|
// Add active class to selected icon
|
||||||
|
const selectedOption = document.querySelector(`.icon-option[data-icon="${iconClass}"]`);
|
||||||
|
if (selectedOption) {
|
||||||
|
selectedOption.classList.add('active');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize icon picker when the page loads
|
// Initialize icon picker when the page loads
|
||||||
|
|||||||
Reference in New Issue
Block a user