2022-04-24 05:18:03 +00:00
|
|
|
<script lang="ts">
|
2022-09-21 08:08:25 +00:00
|
|
|
import { Doc } from '@hcengineering/core'
|
2023-01-14 10:54:54 +00:00
|
|
|
import ui, {
|
2022-10-18 06:33:11 +00:00
|
|
|
Button,
|
|
|
|
IconNavPrev,
|
|
|
|
IconDownOutline,
|
|
|
|
IconUpOutline,
|
|
|
|
panelstore,
|
|
|
|
showPanel,
|
|
|
|
closeTooltip
|
|
|
|
} from '@hcengineering/ui'
|
2022-04-24 05:18:03 +00:00
|
|
|
import { tick } from 'svelte'
|
|
|
|
import { select } from '../actionImpl'
|
|
|
|
import { focusStore } from '../selection'
|
|
|
|
|
|
|
|
export let element: Doc
|
|
|
|
|
|
|
|
async function next (evt: Event, pn: boolean): Promise<void> {
|
|
|
|
select(evt, pn ? 1 : -1, element, 'vertical')
|
|
|
|
await tick()
|
|
|
|
if ($focusStore.focus !== undefined && $panelstore.panel !== undefined) {
|
2022-04-29 05:27:17 +00:00
|
|
|
showPanel(
|
|
|
|
$panelstore.panel.component,
|
|
|
|
$focusStore.focus._id,
|
|
|
|
$focusStore.focus._class,
|
|
|
|
$panelstore.panel?.element ?? 'content',
|
|
|
|
$panelstore.panel.rightSection
|
|
|
|
)
|
2022-04-24 05:18:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-18 06:33:11 +00:00
|
|
|
function goBack () {
|
2022-12-21 06:04:55 +00:00
|
|
|
closeTooltip()
|
|
|
|
history.back()
|
2022-10-18 06:33:11 +00:00
|
|
|
}
|
|
|
|
|
2022-04-29 05:27:17 +00:00
|
|
|
$: select(undefined, 0, element, 'vertical')
|
2022-04-24 05:18:03 +00:00
|
|
|
</script>
|
|
|
|
|
2022-04-29 05:27:17 +00:00
|
|
|
<Button icon={IconDownOutline} kind={'secondary'} size={'medium'} on:click={(evt) => next(evt, true)} />
|
|
|
|
<Button icon={IconUpOutline} kind={'secondary'} size={'medium'} on:click={(evt) => next(evt, false)} />
|
2022-12-21 06:04:55 +00:00
|
|
|
<Button
|
2023-01-14 10:54:54 +00:00
|
|
|
showTooltip={{ label: ui.string.Back, direction: 'bottom' }}
|
2022-12-21 06:04:55 +00:00
|
|
|
icon={IconNavPrev}
|
|
|
|
kind={'secondary'}
|
|
|
|
size={'medium'}
|
|
|
|
on:click={goBack}
|
|
|
|
/>
|