Only wrap iframes that don't specify their own height
(master version of e183a5406c
)
This commit is contained in:
parent
9815e19f01
commit
dc57981376
|
@ -1,6 +1,9 @@
|
|||
// Here we are making iframes responsive. Particularly useful for inline Youtube videos.
|
||||
function wrapFrames() {
|
||||
document.querySelectorAll("iframe").forEach(element => {
|
||||
if (element.height > 0 || parseInt(element.style.height) > 0)
|
||||
return;
|
||||
|
||||
var wrapper = document.createElement("div");
|
||||
wrapper.classList.add("iframeWrap");
|
||||
element.parentNode.insertBefore(wrapper, element);
|
||||
|
|
Loading…
Reference in New Issue