Files
dashy/src/components/IframeModal.vue
T
2021-04-12 19:04:32 +01:00

58 lines
1.0 KiB
Vue

<template>
<modal :name="name" :resizable="true" width="80%" height="80%" @closed="$emit('closed')">
<div slot="top-right" @click="hide()">Close</div>
<a @click="hide()" class="close-button" title="Close">x</a>
<iframe :src="url" @keydown.esc="close" class="frame"/>
</modal>
</template>
<script>
export default {
name: 'IframeModal',
props: {
name: String,
},
data: () => ({
url: '#',
}),
methods: {
show: function show(url) {
this.url = url;
this.$modal.show(this.name);
},
hide: function hide() {
this.$modal.hide(this.name);
},
},
};
</script>
<style lang="scss">
.frame {
width: 100%;
height: 100%;
border: none;
}
.close-button {
position: absolute;
right: 0;
padding: 0.5rem;
border: 0;
border-radius: 0 0 0 10px;
background: var(--primary);
color: var(--background);
border-left: 1px solid var(--primary);
border-bottom: 1px solid var(--primary);
cursor: pointer;
&:hover {
background: var(--background);
color: var(--primary);
}
}
</style>