1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-18 00:28:16 +09:00
hotomoe/src/client/components/url-preview-popup.vue

57 lines
916 B
Vue
Raw Normal View History

2020-02-10 02:59:00 +09:00
<template>
2020-02-10 03:16:34 +09:00
<div class="fgmtyycl _panel" :style="{ top: top + 'px', left: left + 'px' }">
2020-03-22 14:38:33 +09:00
<mk-url-preview :url="url"/>
2020-02-10 02:59:00 +09:00
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../i18n';
2020-03-22 14:38:33 +09:00
import MkUrlPreview from './url-preview.vue';
2020-02-10 02:59:00 +09:00
export default Vue.extend({
i18n,
components: {
2020-03-22 14:38:33 +09:00
MkUrlPreview
2020-02-10 02:59:00 +09:00
},
props: {
url: {
type: String,
required: true
},
source: {
required: true
}
},
data() {
return {
u: null,
top: 0,
left: 0,
};
},
mounted() {
const rect = this.source.getBoundingClientRect();
const x = ((rect.left + (this.source.offsetWidth / 2)) - (300 / 2)) + window.pageXOffset;
const y = rect.top + this.source.offsetHeight + window.pageYOffset;
this.top = y;
this.left = x;
},
});
</script>
<style lang="scss" scoped>
.fgmtyycl {
position: absolute;
z-index: 11000;
2020-02-10 03:13:24 +09:00
width: 500px;
2020-02-10 02:59:00 +09:00
overflow: hidden;
2020-02-10 03:13:24 +09:00
pointer-events: none;
2020-02-10 02:59:00 +09:00
}
</style>