Add IssueView location subscribe (#2440)

Signed-off-by: Denis Maslennikov <denis.maslennikov@gmail.com>

Signed-off-by: Denis Maslennikov <denis.maslennikov@gmail.com>
This commit is contained in:
Denis Maslennikov 2022-12-15 12:08:53 +07:00 committed by GitHub
parent 0673e715df
commit 47a94a7590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,13 +3,14 @@
import { IntlString, translate } from '@hcengineering/platform' import { IntlString, translate } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { Issue } from '@hcengineering/tracker' import { Issue } from '@hcengineering/tracker'
import { Button, IconDetails, IconDetailsFilled } from '@hcengineering/ui' import { Button, IconDetails, IconDetailsFilled, location } from '@hcengineering/ui'
import view, { Viewlet } from '@hcengineering/view' import view, { Viewlet } from '@hcengineering/view'
import { FilterBar, ViewOptionModel, ViewOptionsButton, getActiveViewletId } from '@hcengineering/view-resources' import { FilterBar, ViewOptionModel, ViewOptionsButton, getActiveViewletId } from '@hcengineering/view-resources'
import IssuesContent from './IssuesContent.svelte' import IssuesContent from './IssuesContent.svelte'
import IssuesHeader from './IssuesHeader.svelte' import IssuesHeader from './IssuesHeader.svelte'
import { getDefaultViewOptionsConfig } from '../../utils' import { getDefaultViewOptionsConfig } from '../../utils'
import tracker from '../../plugin' import tracker from '../../plugin'
import { onDestroy } from 'svelte'
export let query: DocumentQuery<Issue> = {} export let query: DocumentQuery<Issue> = {}
export let title: IntlString | undefined = undefined export let title: IntlString | undefined = undefined
@ -63,6 +64,12 @@
let docSize: boolean = false let docSize: boolean = false
$: if (docWidth <= 900 && !docSize) docSize = true $: if (docWidth <= 900 && !docSize) docSize = true
$: if (docWidth > 900 && docSize) docSize = false $: if (docWidth > 900 && docSize) docSize = false
onDestroy(
location.subscribe(() => {
viewOptionsConfig = viewOptionsConfig
})
)
</script> </script>
<IssuesHeader {viewlets} {label} bind:viewlet bind:search showLabelSelector={$$slots.label_selector}> <IssuesHeader {viewlets} {label} bind:viewlet bind:search showLabelSelector={$$slots.label_selector}>