mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Keyboard popup (#1625)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -22,10 +22,10 @@
|
||||
import { Avatar, createQuery, setClient } from '@anticrm/presentation'
|
||||
import {
|
||||
AnyComponent,
|
||||
closePanel,
|
||||
closePopup,
|
||||
closeTooltip,
|
||||
Component,
|
||||
DatePickerPopup,
|
||||
getCurrentLocation,
|
||||
location,
|
||||
Location,
|
||||
@@ -33,12 +33,12 @@
|
||||
PanelInstance,
|
||||
Popup,
|
||||
showPopup,
|
||||
DatePickerPopup,
|
||||
TooltipInstance
|
||||
} from '@anticrm/ui'
|
||||
import { ActionContext, ActionHandler } from '@anticrm/view-resources'
|
||||
import type { Application, NavigatorModel, SpecialNavModel, ViewConfiguration } from '@anticrm/workbench'
|
||||
import { onDestroy, tick } from 'svelte'
|
||||
import { doNavigate } from '../utils'
|
||||
import workbench from '../plugin'
|
||||
import AccountPopup from './AccountPopup.svelte'
|
||||
import AppItem from './AppItem.svelte'
|
||||
@@ -182,36 +182,31 @@
|
||||
}
|
||||
visibileNav = true
|
||||
|
||||
closePanel()
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[1] = app._id
|
||||
loc.path.length = 2
|
||||
navigate(loc)
|
||||
doNavigate([], undefined, {
|
||||
mode: 'app',
|
||||
application: app._id
|
||||
})
|
||||
}
|
||||
|
||||
function selectSpecial (id: string): void {
|
||||
if (currentSpecial === id) return
|
||||
closePanel()
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[2] = id
|
||||
loc.path.length = 3
|
||||
|
||||
doNavigate([], undefined, {
|
||||
mode: 'special',
|
||||
special: id
|
||||
})
|
||||
checkOnHide()
|
||||
navigate(loc)
|
||||
}
|
||||
|
||||
function selectSpace (spaceId?: Ref<Space>, spaceSpecial?: string): void {
|
||||
if (currentSpace === spaceId && (spaceSpecial === currentSpecial || spaceSpecial === asideId)) return
|
||||
closePanel()
|
||||
const loc = getCurrentLocation()
|
||||
if (spaceId !== undefined) {
|
||||
loc.path[2] = spaceId
|
||||
const special = spaceSpecial
|
||||
if (special !== undefined) {
|
||||
loc.path[3] = special
|
||||
}
|
||||
}
|
||||
|
||||
doNavigate([], undefined, {
|
||||
mode: 'space',
|
||||
space: spaceId,
|
||||
spaceSpecial: spaceSpecial
|
||||
})
|
||||
checkOnHide()
|
||||
navigate(loc)
|
||||
}
|
||||
|
||||
function closeAside (): void {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
const addSpace: Action = {
|
||||
label: model.addSpaceLabel,
|
||||
icon: IconAdd,
|
||||
action: async (_id: Ref<Doc>, ev?: Event): Promise<void> => {
|
||||
action: async (_id: Ref<Doc>): Promise<void> => {
|
||||
dispatch('open')
|
||||
showPopup(model.createComponent, {}, 'top')
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
const browseSpaces: Action = {
|
||||
label: plugin.string.BrowseSpaces,
|
||||
icon: IconSearch,
|
||||
action: async (_id: Ref<Doc>, ev?: Event): Promise<void> => {
|
||||
action: async (_id: Ref<Doc>): Promise<void> => {
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[2] = 'spaceBrowser'
|
||||
dispatch('open')
|
||||
@@ -111,7 +111,7 @@
|
||||
label: act.label,
|
||||
action: async (evt: Event) => {
|
||||
const impl = await getResource(act.action)
|
||||
await impl(space, evt)
|
||||
await impl(space, evt, act.actionProps)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
label: act.label,
|
||||
action: async (evt: Event) => {
|
||||
const impl = await getResource(act.action)
|
||||
await impl(space, evt)
|
||||
await impl(space, evt, act.actionProps)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user