Embed block width / height as specified

This commit is contained in:
NH Gooi
2025-07-15 22:01:08 +02:00
parent 4f2c134b67
commit e4d91c2af5

View File

@@ -144,7 +144,7 @@
</div> </div>
</div> </div>
@elseif($block->type == 'embed') @elseif($block->type == 'embed')
<iframe src="{{ $block->data->embed }}" class="article-iframe" id="{{ $id = uniqid('iframe_') }}" scrolling="no" frameborder="0" style="width: 0; min-width: 100% !important; border: none;" data-external="1"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",function(a){if(void 0!==a.data["datawrapper-height"]){var e=document.querySelectorAll("iframe");for(var t in a.data["datawrapper-height"])for(var r,i=0;r=e[i];i++)if(r.contentWindow===a.source){var d=a.data["datawrapper-height"][t]+"px";r.style.height=d}}})}();</script> <iframe src="{{ $block->data->embed }}" class="article-iframe" id="{{ $id = uniqid('iframe_') }}" scrolling="no" frameborder="0" style="width: {{ $block->data->width ?? 0 }}px; height: {{ $block->data->height ?? 0 }}px; min-width: 100% !important; border: none;" data-external="1"></iframe>
@elseif($block->type == 'iframe') @elseif($block->type == 'iframe')
<iframe src="{{ $block->data->url }}" class="article-iframe" id="{{ $id = uniqid('iframe_') }}"></iframe> <iframe src="{{ $block->data->url }}" class="article-iframe" id="{{ $id = uniqid('iframe_') }}"></iframe>
<style> <style>