mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-30 13:35:04 +02:00
fix(todo): broken context actions (#4889)
Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
@@ -158,6 +158,10 @@ export function createModel (builder: Builder): void {
|
||||
titleProvider: time.function.ToDoTitleProvider
|
||||
})
|
||||
|
||||
builder.mixin(time.class.ToDo, core.class.Class, view.mixin.ObjectPanel, {
|
||||
component: time.component.EditToDo
|
||||
})
|
||||
|
||||
builder.createDoc(
|
||||
workbench.class.Application,
|
||||
core.space.Model,
|
||||
@@ -269,14 +273,10 @@ export function createModel (builder: Builder): void {
|
||||
createAction(
|
||||
builder,
|
||||
{
|
||||
action: view.actionImpl.ShowPopup,
|
||||
action: view.actionImpl.ShowPanel,
|
||||
actionProps: {
|
||||
component: time.component.EditToDo,
|
||||
element: 'top',
|
||||
fillProps: {
|
||||
_object: 'object',
|
||||
space: 'space'
|
||||
}
|
||||
element: 'content'
|
||||
},
|
||||
label: time.string.EditToDo,
|
||||
icon: view.icon.Edit,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import type { AnySvelteComponent, PopupOptions, DeviceOptions } from '../types'
|
||||
import Spinner from './Spinner.svelte'
|
||||
|
||||
export let contentPanel: HTMLElement
|
||||
export let contentPanel: HTMLElement | undefined
|
||||
export let kind: 'default' | 'modern' = 'default'
|
||||
export let embedded: boolean = false
|
||||
export let readonly: boolean = false
|
||||
@@ -106,34 +106,39 @@
|
||||
}
|
||||
|
||||
const _update = (): void => {
|
||||
if (props) {
|
||||
if (props && contentPanel) {
|
||||
fitPopup(props, contentPanel)
|
||||
}
|
||||
}
|
||||
|
||||
const checkResize = (el: Element) => {
|
||||
if (props) fitPopup(props, contentPanel)
|
||||
}
|
||||
|
||||
afterUpdate(() => {
|
||||
if (props) fitPopup(props, contentPanel)
|
||||
if (!keepSize && props?.element === 'content' && contentPanel !== undefined) {
|
||||
keepSize = true
|
||||
resizeObserver(contentPanel, checkResize)
|
||||
}
|
||||
})
|
||||
export function fitPopupInstance (): void {
|
||||
if (props) fitPopup(props, contentPanel)
|
||||
if (props && contentPanel) fitPopup(props, contentPanel)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if (props) fitPopup(props, contentPanel)
|
||||
if (props && contentPanel) fitPopup(props, contentPanel)
|
||||
})
|
||||
|
||||
afterUpdate(() => {
|
||||
if (props && contentPanel) fitPopup(props, contentPanel)
|
||||
})
|
||||
|
||||
$: if (props && contentPanel !== undefined) {
|
||||
fitPopup(props, contentPanel)
|
||||
if (!keepSize && props?.element === 'content') {
|
||||
keepSize = true
|
||||
resizeObserver(contentPanel, checkResize)
|
||||
}
|
||||
}
|
||||
|
||||
export function fitPopupInstance (): void {
|
||||
if (props && contentPanel) fitPopup(props, contentPanel)
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
on:resize={() => {
|
||||
if (props) fitPopup(props, contentPanel)
|
||||
if (props && contentPanel) fitPopup(props, contentPanel)
|
||||
}}
|
||||
on:keydown={(evt) => {
|
||||
if (props) handleKeydown(evt)
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
import TopMenu from './icons/TopMenu.svelte'
|
||||
|
||||
let contentPanel: HTMLElement
|
||||
let replacedPanel: HTMLElement
|
||||
let replacedPanel: HTMLElement | undefined
|
||||
|
||||
const { setTheme } = getContext<{ setTheme: (theme: string) => void }>('theme')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user