|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import type { ColumnType, TableType } from 'nocodb-sdk' |
|
|
|
|
import { useGlobal } from '../../composables/useGlobal' |
|
|
|
|
import { |
|
|
|
|
ActiveViewInj, |
|
|
|
|
FieldsInj, |
|
|
|
@ -20,7 +19,6 @@ import {
|
|
|
|
|
useMetas, |
|
|
|
|
useProvideKanbanViewStore, |
|
|
|
|
useProvideSmartsheetStore, |
|
|
|
|
useSidebar, |
|
|
|
|
useUIPermission, |
|
|
|
|
} from '#imports' |
|
|
|
|
import type { TabItem } from '~/lib' |
|
|
|
@ -37,8 +35,6 @@ const activeTab = toRef(props, 'activeTab')
|
|
|
|
|
|
|
|
|
|
const activeView = ref() |
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
const fields = ref<ColumnType[]>([]) |
|
|
|
|
|
|
|
|
|
const meta = computed<TableType | undefined>(() => activeTab.value && metas.value[activeTab.value.id!]) |
|
|
|
@ -67,42 +63,6 @@ provide(
|
|
|
|
|
ReadonlyInj, |
|
|
|
|
computed(() => !isUIAllowed('xcDatatableEditable')), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const { isOpen: isRightSidebarOpen, toggle: toggleRightSidebar } = useSidebar('nc-right-sidebar') |
|
|
|
|
|
|
|
|
|
const rightSidebar = document.querySelector('.nc-right-sidebar') |
|
|
|
|
const rightSidebarToggleButton = document.querySelector('.nc-views-show-sidebar-button') |
|
|
|
|
|
|
|
|
|
document.addEventListener('click', (event: MouseEvent) => { |
|
|
|
|
// debugger |
|
|
|
|
|
|
|
|
|
console.log('++++++++') |
|
|
|
|
console.log('event.target: ', event.target) |
|
|
|
|
console.log('rightSidebarToggleButton: ', rightSidebarToggleButton) |
|
|
|
|
console.log('isSameNode: ', rightSidebarToggleButton?.isSameNode(event.target as Node)) |
|
|
|
|
console.log('contains: ', rightSidebarToggleButton?.contains(event.target as Node)) |
|
|
|
|
console.log('--------') |
|
|
|
|
|
|
|
|
|
// sidebar.value. |
|
|
|
|
// event.stopPropagation() |
|
|
|
|
// event.preventDefault() |
|
|
|
|
// event.stopImmediatePropagation() |
|
|
|
|
|
|
|
|
|
// alert(JSON.stringify(rightSidebarToggleButton?.contains(event.target as Node))) |
|
|
|
|
|
|
|
|
|
// const sidebarFoo = sidebar.value |
|
|
|
|
// alert(JSON.stringify(sidebarFoo)) |
|
|
|
|
// if (isMobileMode.value && !sidebar.value?.contains(event.target as Node)) { |
|
|
|
|
if ( |
|
|
|
|
isMobileMode.value && |
|
|
|
|
isRightSidebarOpen.value && |
|
|
|
|
!rightSidebar?.contains(event.target as Node) && |
|
|
|
|
!rightSidebarToggleButton?.contains(event.target as Node) |
|
|
|
|
) { |
|
|
|
|
// alert(JSON.stringify(rightSidebarToggleButton?.innerHTML)) |
|
|
|
|
// toggleRightSidebar() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|