2021-08-24 17:35:06 +02:00
|
|
|
<script lang="ts">
|
2021-08-27 10:34:03 +02:00
|
|
|
import {onDestroy, onMount} from "svelte";
|
|
|
|
import {iframeListener} from "../../Api/IframeListener";
|
2021-08-24 17:35:06 +02:00
|
|
|
|
2021-08-27 10:34:03 +02:00
|
|
|
export let url: string;
|
|
|
|
export let allowApi: boolean;
|
|
|
|
|
|
|
|
let HTMLIframe: HTMLIFrameElement;
|
|
|
|
|
|
|
|
onMount( () => {
|
|
|
|
if (allowApi) {
|
|
|
|
iframeListener.registerIframe(HTMLIframe);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
onDestroy( () => {
|
|
|
|
if (allowApi) {
|
|
|
|
iframeListener.unregisterIframe(HTMLIframe);
|
|
|
|
}
|
|
|
|
})
|
2021-08-24 17:35:06 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2021-08-27 10:34:03 +02:00
|
|
|
<iframe title="customSubMenu" src="{url}" bind:this={HTMLIframe}></iframe>
|
2021-08-24 17:35:06 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
iframe {
|
|
|
|
border: none;
|
|
|
|
height: calc(100% - 56px);
|
|
|
|
width: 100%;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|