mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 17:45:02 +02:00
Add open parent issue button for a sub-issue edit panel (#2304)
* add open parent issue button for a sub-issue edit panel Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * simplify getting reactive var value Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * make UpDownNavigator more universal Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { Doc } from '@hcengineering/core'
|
||||
import { Button, IconDownOutline, IconUpOutline, panelstore, showPanel } from '@hcengineering/ui'
|
||||
import {
|
||||
Button,
|
||||
IconNavPrev,
|
||||
IconDownOutline,
|
||||
IconUpOutline,
|
||||
panelstore,
|
||||
showPanel,
|
||||
closeTooltip
|
||||
} from '@hcengineering/ui'
|
||||
import { tick } from 'svelte'
|
||||
import { select } from '../actionImpl'
|
||||
import { focusStore } from '../selection'
|
||||
import tracker from '../../../tracker-resources/src/plugin'
|
||||
|
||||
export let element: Doc
|
||||
export let showBackButton: boolean = false
|
||||
|
||||
async function next (evt: Event, pn: boolean): Promise<void> {
|
||||
select(evt, pn ? 1 : -1, element, 'vertical')
|
||||
@@ -21,8 +31,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
function goBack () {
|
||||
if (showBackButton) {
|
||||
closeTooltip()
|
||||
history.back()
|
||||
}
|
||||
}
|
||||
|
||||
$: select(undefined, 0, element, 'vertical')
|
||||
</script>
|
||||
|
||||
<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)} />
|
||||
|
||||
{#if showBackButton}
|
||||
<Button
|
||||
showTooltip={{ label: tracker.string.Back, direction: 'bottom' }}
|
||||
icon={IconNavPrev}
|
||||
kind={'secondary'}
|
||||
size={'medium'}
|
||||
on:click={goBack}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user