Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 661 Bytes

03_iframe.md

File metadata and controls

31 lines (25 loc) · 661 Bytes

Iframe Component

This component will enable the iframe rendering. We can't provide any out-of-the-box solution for changing the iframe height dynamically (cross-domain policy), so you need to take care about that by yourself.

Enable Extension

import {Iframe} from 'js-pimcore-toolbox';
document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.toolbox-iframe').forEach((el) => {
        new Iframe(el);
    });
});

Extended Usage

new Iframe(el, {
    invalidClass: 'iframe-invalid',
    loadedClass: 'iframe-loaded',
    onLoad: (iframe) => {
    },
    onLoaded: (iframe) => {
    },
});