Browse Source

mobile optimisations - work on merging right and left sidebar (WIP)

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
2c00e76f39
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 4
      packages/nc-gui/components/dashboard/TreeView.vue
  2. 8
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue

4
packages/nc-gui/components/dashboard/TreeView.vue

@ -31,6 +31,9 @@ import {
import MdiView from '~icons/mdi/eye-circle-outline'
import MdiTableLarge from '~icons/mdi/table-large'
const emit = defineEmits(['clickedTableLink'])
const { isMobileMode } = useGlobal()
const { addTab, updateTab } = useTabs()
@ -168,6 +171,7 @@ const reloadTables = async () => {
}
const addTableTab = (table: TableType) => {
emit('clickedTableLink')
addTab({ title: table.title, id: table.id, type: table.type as TabType })
}

8
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -202,6 +202,12 @@ onMounted(() => {
toggleHasSidebar(true)
})
const onClickedTableLink = () => {
if (isMobileMode) {
showViewsMobileSidebar.value = true
}
}
onBeforeUnmount(reset)
function openKeyboardShortcutDialog() {
@ -598,7 +604,7 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
<!-- v-show="isMobileRightSidebarOpen" -->
<!-- meta: {{ JSON.stringify(meta) }} <br />
isMobileMode: {{ JSON.stringify(isMobileMode) }} <br /> -->
<LazyDashboardTreeView v-if="!(isMobileMode && showViewsMobileSidebar)" />
<LazyDashboardTreeView v-if="!(isMobileMode && showViewsMobileSidebar)" @clicked-table-link="onClickedTableLink" />
<SmartsheetSidebarMobile v-if="meta && isMobileMode && showViewsMobileSidebar" class="nc-left-sidebar-mobile" />
</a-layout-sider>
</template>

Loading…
Cancel
Save