mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 02:37:44 +02:00
TSK-1410,-1408,-1392,-1389,-1386,-1377: Minor fixes. Update IssueNotification layout. (#3117)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
@@ -15,16 +15,15 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { resizeObserver } from '@hcengineering/ui'
|
||||
import { afterUpdate, onDestroy } from 'svelte'
|
||||
import { afterUpdate } from 'svelte'
|
||||
import { fixedWidthStore } from '../utils'
|
||||
|
||||
export let key: string
|
||||
export let justify: string = ''
|
||||
export let addClass: string | undefined = undefined
|
||||
let prevKey = key
|
||||
let element: HTMLDivElement | undefined
|
||||
|
||||
let cWidth: number | undefined = undefined
|
||||
let prevKey = key
|
||||
|
||||
afterUpdate(() => {
|
||||
if (cWidth !== undefined) {
|
||||
@@ -39,21 +38,11 @@
|
||||
|
||||
function resize (element: Element) {
|
||||
cWidth = element.clientWidth
|
||||
if (cWidth > ($fixedWidthStore[key] ?? 0)) {
|
||||
$fixedWidthStore[key] = cWidth
|
||||
}
|
||||
if (cWidth > ($fixedWidthStore[key] ?? 0)) $fixedWidthStore[key] = cWidth
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
if (cWidth === $fixedWidthStore[key]) {
|
||||
// If we are longest element
|
||||
$fixedWidthStore[key] = 0
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<div
|
||||
bind:this={element}
|
||||
class="flex-no-shrink{addClass ? ` ${addClass}` : ''}"
|
||||
style:text-align={justify !== '' ? justify : ''}
|
||||
style:min-width={`${$fixedWidthStore[key] ?? 0}px`}
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
getCategories,
|
||||
getGroupByValues,
|
||||
getPresenter,
|
||||
groupBy
|
||||
groupBy,
|
||||
fixedWidthStore
|
||||
} from '../../utils'
|
||||
import { CategoryQuery, noCategory } from '../../viewOptions'
|
||||
import ListCategory from './ListCategory.svelte'
|
||||
@@ -112,6 +113,10 @@
|
||||
$: getHeader(_class, groupByKey)
|
||||
$: buildModel({ client, _class, keys: config, lookup }).then((res) => {
|
||||
itemModels = res
|
||||
res.forEach((m) => {
|
||||
const key = `list_item_${m.props?.listProps.key}`
|
||||
if (m.props?.listProps?.fixed) $fixedWidthStore[key] = 0
|
||||
})
|
||||
})
|
||||
|
||||
function getInitIndex (categories: any, i: number): number {
|
||||
|
||||
Reference in New Issue
Block a user