mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 11:23:08 +02:00
3963ed8ff7
* wip * tabun ok * better msg * oops * fix lint * Update gulpfile.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * Update src/client/scripts/set-i18n-contexts.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * refactor Co-authored-by: acid-chicken <root@acid-chicken.com> * ✨ * wip * fix lint * たぶんおk * fix flush * Translate Notification * remove console.log * fix * add notifications * remove san * wip * ok * ✌️ * Update src/prelude/array.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * wip * i18n refactor * Update init.ts * ✌️ Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
54 lines
922 B
Vue
54 lines
922 B
Vue
<template>
|
|
<div class="fgmtyycl _panel" :style="{ top: top + 'px', left: left + 'px' }">
|
|
<mk-url-preview :url="url"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Vue from 'vue';
|
|
import MkUrlPreview from './url-preview.vue';
|
|
|
|
export default Vue.extend({
|
|
components: {
|
|
MkUrlPreview
|
|
},
|
|
|
|
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 = Math.max((rect.left + (this.source.offsetWidth / 2)) - (300 / 2), 6) + 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;
|
|
width: 500px;
|
|
max-width: calc(90vw - 12px);
|
|
overflow: hidden;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|