diff --git a/admin-dashboard.html b/admin-dashboard.html index 90b51f7..06efad9 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -1096,9 +1096,9 @@ document.addEventListener('DOMContentLoaded', () => { const dropArea = document.getElementById('dropArea'); // Initialize image position buttons - document.querySelectorAll('.position-btn').forEach(btn => { + document.querySelectorAll('.image-pos-btn, .position-btn').forEach(btn => { btn.addEventListener('click', function() { - document.querySelectorAll('.position-btn').forEach(b => { + document.querySelectorAll('.image-pos-btn, .position-btn').forEach(b => { b.classList.remove('active', 'btn-primary'); b.classList.add('btn-outline-secondary'); }); @@ -1903,11 +1903,14 @@ function updateBannerPreview() { const bannerTextContent = bannerText || 'Náhled banneru'; if (hasImage && currentImage) { - // Get image dimensions from inputs or use defaults + // Get image dimensions and position from inputs or use defaults const imageWidth = parseInt(document.getElementById('bannerImageWidth')?.value || '300'); const imageHeight = parseInt(document.getElementById('bannerImageHeight')?.value || '200'); const imagePosition = document.getElementById('bannerImagePosition')?.value || 'right'; + // Log the current position for debugging + console.log('Image position:', imagePosition); + // Create image container with proper styling and positioning const isSideBySide = imagePosition === 'left' || imagePosition === 'right'; const maxWidth = isSideBySide ? '40%' : '100%'; @@ -1978,6 +1981,9 @@ function updateBannerPreview() { margin: (template.margin ? `${template.margin}px` : '20px').trim(), borderRadius: (template.borderRadius ? `${template.borderRadius}px` : '8px').trim(), + // Image position + imagePosition: imagePosition, + // Container styles containerStyle: (template.containerStyle || '').trim() };