Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSK-1524/UBER-195 #3230

Merged
merged 2 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/panel/src/components/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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>>({})

Expand Down Expand Up @@ -86,6 +88,10 @@
startScrollHeightCheck()
}
})

onMount(() => {
dispatch('open')
})
</script>

<Panel
Expand Down
17 changes: 15 additions & 2 deletions packages/ui/src/components/PanelInstance.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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}
Expand All @@ -142,6 +154,7 @@
rightSection={props.rightSection}
position={props.element}
bind:popupOptions={options}
on:open={_open}
on:close={_close}
on:update={_update}
/>
Expand Down
1 change: 1 addition & 0 deletions plugins/document-resources/src/components/EditDoc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
bind:innerWidth
floatAside={false}
useMaxWidth={true}
on:open
on:close={() => dispatch('close')}
>
<svelte:fragment slot="navigator">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@
}
}

onMount(() => {
dispatch('open', { ignoreKeys: ['comments', 'name', 'description', 'number'] })
})

const manager = createFocusManager()
export function canClose (): boolean {
if (descriptionBox.isFocused()) {
Expand Down Expand Up @@ -176,6 +172,7 @@
{embedded}
withoutTitle
bind:innerWidth
on:open
on:close={() => dispatch('close')}
>
<svelte:fragment slot="navigator">
Expand Down
1 change: 1 addition & 0 deletions plugins/view-resources/src/components/EditDoc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
isAside={true}
bind:panelWidth
bind:innerWidth
on:open
on:update={(ev) => _update(ev.detail)}
on:close={() => {
dispatch('close')
Expand Down