TSK-1524/UBER-195 (#3230)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-05-22 15:25:45 +06:00 committed by GitHub
parent 818067dad9
commit fb5c4b1f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 8 deletions

View File

@ -14,7 +14,7 @@
// limitations under the License.
-->
<script lang="ts">
import { afterUpdate } from 'svelte'
import { afterUpdate, createEventDispatcher, onMount } from 'svelte'
import { Writable, writable } from 'svelte/store'
import activity from '@hcengineering/activity'
@ -56,6 +56,8 @@
let lastScrollHeight: number = -1
let count: number = 0
const dispatch = createEventDispatcher()
const waitCount = 10
const PanelScrollTop: Writable<Record<string, number>> = writable<Record<string, number>>({})
@ -86,6 +88,10 @@
startScrollHeightCheck()
}
})
onMount(() => {
dispatch('open')
})
</script>
<Panel

View File

@ -89,8 +89,20 @@
}
}
function _open (): void {
if (modalHTML && props) {
if (props.element === 'content') {
modalHTML.classList.add('bg')
} else {
modalHTML.classList.remove('bg')
}
}
}
const _update = (): void => {
if (props) fitPopup(props, contentPanel)
if (props) {
fitPopup(props, contentPanel)
}
}
afterUpdate(() => {
@ -120,7 +132,7 @@
<slot name="panel-header" />
<div
class="panel-instance"
class:bg={props.element === 'content'}
class:bg={false}
bind:this={modalHTML}
style:top={options?.props?.top}
style:bottom={options?.props?.bottom}
@ -142,6 +154,7 @@
rightSection={props.rightSection}
position={props.element}
bind:popupOptions={options}
on:open={_open}
on:close={_close}
on:update={_update}
/>

View File

@ -380,6 +380,7 @@
bind:innerWidth
floatAside={false}
useMaxWidth={true}
on:open
on:close={() => dispatch('close')}
>
<svelte:fragment slot="navigator">

View File

@ -35,7 +35,7 @@
showPopup
} from '@hcengineering/ui'
import { ActionContext, ContextMenu, DocNavLink, UpDownNavigator, contextStore } from '@hcengineering/view-resources'
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
import { createEventDispatcher, onDestroy } from 'svelte'
import { generateIssueShortLink, getIssueId } from '../../../issues'
import tracker from '../../../plugin'
import IssueStatusActivity from '../IssueStatusActivity.svelte'
@ -140,10 +140,6 @@
}
}
onMount(() => {
dispatch('open', { ignoreKeys: ['comments', 'name', 'description', 'number'] })
})
const manager = createFocusManager()
export function canClose (): boolean {
if (descriptionBox.isFocused()) {
@ -176,6 +172,7 @@
{embedded}
withoutTitle
bind:innerWidth
on:open
on:close={() => dispatch('close')}
>
<svelte:fragment slot="navigator">

View File

@ -283,6 +283,7 @@
isAside={true}
bind:panelWidth
bind:innerWidth
on:open
on:update={(ev) => _update(ev.detail)}
on:close={() => {
dispatch('close')