workadventure/front/src/Components/Menu/CustomSubMenu.svelte

33 lines
697 B
Svelte
Raw Normal View History

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