Browse Source

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

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

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

@ -168,7 +168,9 @@ const reloadTables = async () => {
} }
const addTableTab = (table: TableType) => { const addTableTab = (table: TableType) => {
if (isMobileMode) {
$globalEventBus.emit(GlobalEvents.CLICKED_TABLE_LINK_IN_MOBILE_MODE) $globalEventBus.emit(GlobalEvents.CLICKED_TABLE_LINK_IN_MOBILE_MODE)
}
addTab({ title: table.title, id: table.id, type: table.type as TabType }) addTab({ title: table.title, id: table.id, type: table.type as TabType })
} }

4
packages/nc-gui/components/tabs/Smartsheet.vue

@ -86,8 +86,10 @@ onMounted(() => {
mainArea.value?.addEventListener('click', hideSidebarOnClickOrTouchIfMobileMode) mainArea.value?.addEventListener('click', hideSidebarOnClickOrTouchIfMobileMode)
}) })
watch(meta, () => { watch(meta, (newMeta, oldMeta) => {
if (newMeta?.id !== oldMeta?.id) {
toggleMobileRightSidebar(true) toggleMobileRightSidebar(true)
}
}) })
const FOO = (ev: GlobalEvents) => { const FOO = (ev: GlobalEvents) => {

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

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import type { GlobalEvents } from '~/lib'
import { import {
TabType, TabType,
computed, computed,
@ -38,7 +39,7 @@ const { theme, defaultTheme } = useTheme()
const { t } = useI18n() const { t } = useI18n()
const { $e } = useNuxtApp() const { $e, $globalEventBus } = useNuxtApp()
const route = useRoute() const route = useRoute()
@ -187,7 +188,16 @@ onBeforeMount(async () => {
} }
}) })
const FOO = (ev: GlobalEvents) => {
console.log(ev)
// alert('event')
if (isMobileMode) {
toggle(false)
}
}
onMounted(() => { onMounted(() => {
$globalEventBus.on(FOO)
toggle(true) toggle(true)
toggleHasSidebar(true) toggleHasSidebar(true)
}) })

Loading…
Cancel
Save