2021-08-24 17:35:06 +02:00
|
|
|
<script lang="ts">
|
2021-12-06 16:12:37 +01: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;
|
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
onMount(() => {
|
2021-08-27 10:34:03 +02:00
|
|
|
if (allowApi) {
|
|
|
|
iframeListener.registerIframe(HTMLIframe);
|
|
|
|
}
|
2021-12-06 16:12:37 +01:00
|
|
|
});
|
2021-08-27 10:34:03 +02:00
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
onDestroy(() => {
|
2021-08-27 10:34:03 +02:00
|
|
|
if (allowApi) {
|
|
|
|
iframeListener.unregisterIframe(HTMLIframe);
|
|
|
|
}
|
2021-12-06 16:12:37 +01:00
|
|
|
});
|
2021-08-24 17:35:06 +02:00
|
|
|
</script>
|
|
|
|
|
2021-12-06 16:12:37 +01:00
|
|
|
<iframe title="customSubMenu" src={url} bind:this={HTMLIframe} />
|
2021-08-24 17:35:06 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2021-12-06 16:12:37 +01:00
|
|
|
iframe {
|
|
|
|
border: none;
|
|
|
|
height: calc(100% - 56px);
|
|
|
|
width: 100%;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|