Browse Source

chore: refactor

pull/8990/head
DarkPhoenix2704 4 months ago
parent
commit
f146c7306d
No known key found for this signature in database
GPG Key ID: 3F76B10622A07849
  1. 17
      packages/nc-gui/components/cell/attachment/Carousel.vue

17
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -37,7 +37,7 @@ const { getPossibleAttachmentSrc } = useAttachment()
useEventListener(container, 'click', (e) => { useEventListener(container, 'click', (e) => {
const target = e.target as HTMLElement const target = e.target as HTMLElement
if (!target.closest('.keep-open') || !target.closest('.nc-button')) { if (!target.closest('.keep-open') || !target.closest('.nc-button') || !target?.closest('img') || !target?.closest('video')) {
selectedFile.value = false selectedFile.value = false
} }
}) })
@ -83,8 +83,11 @@ watchOnce(emblaMainApi, async (emblaMainApi) => {
<template> <template>
<GeneralOverlay v-model="selectedFile" transition :z-index="50" class="bg-black bg-opacity-90"> <GeneralOverlay v-model="selectedFile" transition :z-index="50" class="bg-black bg-opacity-90">
<div v-if="selectedFile" class="flex w-full justify-center items-center"> <div
<div ref="container" class="overflow-hidden w-full flex items-center justify-center text-center relative h-screen"> v-if="selectedFile"
ref="container"
class="flex w-full overflow-hidden justify-center text-center relative h-screen items-center"
>
<NcButton <NcButton
class="top-5 !absolute cursor-pointer !hover:bg-transparent left-5" class="top-5 !absolute cursor-pointer !hover:bg-transparent left-5"
size="xsmall" size="xsmall"
@ -100,16 +103,13 @@ watchOnce(emblaMainApi, async (emblaMainApi) => {
<h3 <h3
style="width: max-content" style="width: max-content"
class="hover:underline pointer-events-auto font-semibold cursor-pointer text-white" class="hover:underline pointer-events-auto font-semibold cursor-pointer text-white"
@click.stop="downloadAttachment(selectedImage)" @click.stop="downloadAttachment(selectedFile)"
> >
{{ selectedFile && selectedFile.title }} {{ selectedFile && selectedFile.title }}
</h3> </h3>
</div> </div>
<NcCarousel <NcCarousel class="!absolute inset-16 keep-open flex justify-center items-center" @init-api="(val) => (emblaMainApi = val)">
class="!absolute inset-16 keep-open flex justify-center items-center"
@init-api="(val) => (emblaMainApi = val)"
>
<NcCarouselContent> <NcCarouselContent>
<NcCarouselItem v-for="(item, index) in visibleItems" :key="index"> <NcCarouselItem v-for="(item, index) in visibleItems" :key="index">
<div class="w-full h-full justify-center flex items-center"> <div class="w-full h-full justify-center flex items-center">
@ -230,7 +230,6 @@ watchOnce(emblaMainApi, async (emblaMainApi) => {
</template> </template>
</GeneralDeleteModal> </GeneralDeleteModal>
</div> </div>
</div>
</GeneralOverlay> </GeneralOverlay>
</template> </template>

Loading…
Cancel
Save