From 43409abb5dac742147a4b139e2c49a089523d6f3 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 9 Sep 2022 16:00:23 +0800 Subject: [PATCH] feat(nc-gui): add IsKanbanInj & isKanban --- packages/nc-gui/components/cell/attachment/index.vue | 5 ++++- packages/nc-gui/context/index.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/cell/attachment/index.vue b/packages/nc-gui/components/cell/attachment/index.vue index 8c88a86b4e..8764a4eac9 100644 --- a/packages/nc-gui/components/cell/attachment/index.vue +++ b/packages/nc-gui/components/cell/attachment/index.vue @@ -7,6 +7,7 @@ import Carousel from './Carousel.vue' import { IsFormInj, IsGalleryInj, + IsKanbanInj, inject, isImage, nextTick, @@ -35,6 +36,8 @@ const isForm = inject(IsFormInj, ref(false)) const isGallery = inject(IsGalleryInj, ref(false)) +const isKanban = inject(IsKanbanInj, ref(false)) + const attachmentCellRef = ref() const sortableRef = ref() @@ -60,7 +63,7 @@ const currentCellRef = ref() watch( [() => rowIndex, isForm], () => { - if (!rowIndex && isForm.value && isGallery.value) { + if (!rowIndex && isForm.value && isGallery.value && isKanban.value) { currentCellRef.value = attachmentCellRef.value } else { nextTick(() => { diff --git a/packages/nc-gui/context/index.ts b/packages/nc-gui/context/index.ts index a2463cfa08..e45a1d08ec 100644 --- a/packages/nc-gui/context/index.ts +++ b/packages/nc-gui/context/index.ts @@ -17,6 +17,7 @@ export const ChangePageInj: InjectionKey['changeP export const IsFormInj: InjectionKey> = Symbol('is-form-injection') export const IsGridInj: InjectionKey> = Symbol('is-grid-injection') export const IsGalleryInj: InjectionKey> = Symbol('is-gallery-injection') +export const IsKanbanInj: InjectionKey> = Symbol('is-kanban-injection') export const IsLockedInj: InjectionKey> = Symbol('is-locked-injection') export const CellValueInj: InjectionKey> = Symbol('cell-value-injection') export const ActiveViewInj: InjectionKey> = Symbol('active-view-injection')