From d4ed6411b9bc324eac73be214979b19f611dca18 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 29 May 2025 11:45:26 +0200 Subject: [PATCH] f --- admin-dashboard.html | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/admin-dashboard.html b/admin-dashboard.html index 7d5e9a6..adab572 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -1001,27 +1001,16 @@ function updateBannerPreview() { `; - // Add image if exists + // Add image if exists (always on the right) if (hasImage) { - const imagePosition = document.querySelector('.image-pos-btn.active')?.dataset.pos || 'center'; - let imageStyle = 'max-width: 100%; max-height: 100%; object-fit: contain;'; - - // Apply position based on selection - switch(imagePosition) { - case 'left': - imageStyle += 'margin-right: auto;'; - break; - case 'right': - imageStyle += 'margin-left: auto;'; - break; - case 'center': - default: - imageStyle += 'margin: 0 auto;'; - break; - } - previewHTML += ` - Banner preview + Banner preview `; } @@ -1092,12 +1081,7 @@ document.addEventListener('DOMContentLoaded', () => { const removeImageBtn = document.getElementById('removeImageBtn'); const dropArea = document.getElementById('dropArea'); - // Image is always on the right side - const rightPositionBtn = document.querySelector('.image-pos-btn[data-pos="right"], .position-btn[data-pos="right"]'); - if (rightPositionBtn) { - rightPositionBtn.classList.add('active', 'btn-primary'); - rightPositionBtn.classList.remove('btn-outline-secondary'); - } + // Image is always on the right side - no position selector needed // Handle file selection function handleFileSelect(file) { @@ -1894,10 +1878,10 @@ function updateBannerPreview() { const bannerTextContent = bannerText || 'Náhled banneru'; if (hasImage && currentImage) { - // Get image dimensions and position from inputs or use defaults + // Get image dimensions (position is always right) const imageWidth = parseInt(document.getElementById('bannerImageWidth')?.value || '300'); const imageHeight = parseInt(document.getElementById('bannerImageHeight')?.value || '200'); - const imagePosition = document.getElementById('bannerImagePosition')?.value || 'right'; + const imagePosition = 'right'; // Always right-aligned // Log the current position for debugging console.log('Image position:', imagePosition); @@ -1967,8 +1951,8 @@ function updateBannerPreview() { margin: (template.margin ? `${template.margin}px` : '20px').trim(), borderRadius: (template.borderRadius ? `${template.borderRadius}px` : '8px').trim(), - // Image position - imagePosition: imagePosition, + // Image position (always right) + imagePosition: 'right', // Container styles containerStyle: (template.containerStyle || '').trim()