blob: 3762324a43137006ddc191649aafb477fd33bee6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import { NodeViewWrapper } from '@tiptap/vue-2';
export default {
name: 'ImageWrapper',
components: {
NodeViewWrapper,
GlLoadingIcon,
},
props: {
node: {
type: Object,
required: true,
},
},
};
</script>
<template>
<node-view-wrapper class="gl-display-inline-block">
<span class="gl-relative">
<img
data-testid="image"
class="gl-max-w-full gl-h-auto"
:class="{ 'gl-opacity-5': node.attrs.uploading }"
:src="node.attrs.src"
/>
<gl-loading-icon v-if="node.attrs.uploading" class="gl-absolute gl-left-50p gl-top-half" />
</span>
</node-view-wrapper>
</template>
|