mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 04:22:58 +00:00
g
This commit is contained in:
@@ -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()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user