mirror of
https://github.com/BrenBroZAYT/dashy.git
synced 2026-06-14 00:49:58 +00:00
58 lines
1.0 KiB
Vue
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>
|