Browse Source

feat(nc-gui): add IsKanbanInj & isKanban

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
43409abb5d
  1. 5
      packages/nc-gui/components/cell/attachment/index.vue
  2. 1
      packages/nc-gui/context/index.ts

5
packages/nc-gui/components/cell/attachment/index.vue

@ -7,6 +7,7 @@ import Carousel from './Carousel.vue'
import { import {
IsFormInj, IsFormInj,
IsGalleryInj, IsGalleryInj,
IsKanbanInj,
inject, inject,
isImage, isImage,
nextTick, nextTick,
@ -35,6 +36,8 @@ const isForm = inject(IsFormInj, ref(false))
const isGallery = inject(IsGalleryInj, ref(false)) const isGallery = inject(IsGalleryInj, ref(false))
const isKanban = inject(IsKanbanInj, ref(false))
const attachmentCellRef = ref<HTMLDivElement>() const attachmentCellRef = ref<HTMLDivElement>()
const sortableRef = ref<HTMLDivElement>() const sortableRef = ref<HTMLDivElement>()
@ -60,7 +63,7 @@ const currentCellRef = ref()
watch( watch(
[() => rowIndex, isForm], [() => rowIndex, isForm],
() => { () => {
if (!rowIndex && isForm.value && isGallery.value) { if (!rowIndex && isForm.value && isGallery.value && isKanban.value) {
currentCellRef.value = attachmentCellRef.value currentCellRef.value = attachmentCellRef.value
} else { } else {
nextTick(() => { nextTick(() => {

1
packages/nc-gui/context/index.ts

@ -17,6 +17,7 @@ export const ChangePageInj: InjectionKey<ReturnType<typeof useViewData>['changeP
export const IsFormInj: InjectionKey<Ref<boolean>> = Symbol('is-form-injection') export const IsFormInj: InjectionKey<Ref<boolean>> = Symbol('is-form-injection')
export const IsGridInj: InjectionKey<Ref<boolean>> = Symbol('is-grid-injection') export const IsGridInj: InjectionKey<Ref<boolean>> = Symbol('is-grid-injection')
export const IsGalleryInj: InjectionKey<Ref<boolean>> = Symbol('is-gallery-injection') export const IsGalleryInj: InjectionKey<Ref<boolean>> = Symbol('is-gallery-injection')
export const IsKanbanInj: InjectionKey<Ref<boolean>> = Symbol('is-kanban-injection')
export const IsLockedInj: InjectionKey<Ref<boolean>> = Symbol('is-locked-injection') export const IsLockedInj: InjectionKey<Ref<boolean>> = Symbol('is-locked-injection')
export const CellValueInj: InjectionKey<Ref<any>> = Symbol('cell-value-injection') export const CellValueInj: InjectionKey<Ref<any>> = Symbol('cell-value-injection')
export const ActiveViewInj: InjectionKey<Ref<ViewType>> = Symbol('active-view-injection') export const ActiveViewInj: InjectionKey<Ref<ViewType>> = Symbol('active-view-injection')

Loading…
Cancel
Save