2020-02-09 11:59:00 -06:00
|
|
|
<template>
|
2020-07-12 04:36:14 -05:00
|
|
|
<div class="fgmtyycl _panel _shadow" :style="{ top: top + 'px', left: left + 'px' }">
|
2020-03-22 00:38:33 -05:00
|
|
|
<mk-url-preview :url="url"/>
|
2020-02-09 11:59:00 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2020-03-22 00:38:33 -05:00
|
|
|
import MkUrlPreview from './url-preview.vue';
|
2020-02-09 11:59:00 -06:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
2020-03-22 00:38:33 -05:00
|
|
|
MkUrlPreview
|
2020-02-09 11:59:00 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
url: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
source: {
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
u: null,
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
const rect = this.source.getBoundingClientRect();
|
2020-04-13 10:00:52 -05:00
|
|
|
const x = Math.max((rect.left + (this.source.offsetWidth / 2)) - (300 / 2), 6) + window.pageXOffset;
|
2020-02-09 11:59:00 -06:00
|
|
|
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-09 12:13:24 -06:00
|
|
|
width: 500px;
|
2020-04-13 10:00:52 -05:00
|
|
|
max-width: calc(90vw - 12px);
|
2020-02-09 11:59:00 -06:00
|
|
|
overflow: hidden;
|
2020-02-09 12:13:24 -06:00
|
|
|
pointer-events: none;
|
2020-02-09 11:59:00 -06:00
|
|
|
}
|
|
|
|
</style>
|