Normalisiere die Anzeigegröße und passe die Position von eingefügten Elementen im Header-Anzeigenplatzhalter an

This commit is contained in:
Torsten Schulz (local)
2026-05-18 15:54:08 +02:00
parent c8059f94f8
commit a17dd00048

View File

@@ -201,8 +201,30 @@ async function renderPropeller() {
} }
const moved = placeholder.firstElementChild; const moved = placeholder.firstElementChild;
if (moved) { if (moved) {
// Normalize size
moved.style.maxWidth = '100%'; moved.style.maxWidth = '100%';
moved.style.display = 'block'; moved.style.display = 'block';
// If provider inserted a fixed/absolute positioned element (overlays),
// force it to behave as inline block inside our header placeholder.
try {
const cs = getComputedStyle(moved);
if (cs.position === 'fixed' || cs.position === 'absolute') {
moved.style.setProperty('position', 'relative', 'important');
moved.style.setProperty('top', 'auto', 'important');
moved.style.setProperty('right', 'auto', 'important');
moved.style.setProperty('left', 'auto', 'important');
moved.style.setProperty('bottom', 'auto', 'important');
moved.style.setProperty('z-index', '1', 'important');
moved.style.setProperty('width', '100%', 'important');
moved.style.setProperty('max-width', '970px', 'important');
}
if (moved.tagName === 'IFRAME') {
moved.style.width = '100%';
moved.style.height = moved.style.height || '60px';
}
} catch (e) {
console.warn('style normalize failed', e);
}
} }
observer.disconnect(); observer.disconnect();
try { window.dispatchEvent(new CustomEvent('ads:relocated',{detail:{provider:'propeller',zone:propSlotId}})); } catch {} try { window.dispatchEvent(new CustomEvent('ads:relocated',{detail:{provider:'propeller',zone:propSlotId}})); } catch {}