fix popup result

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-03 11:17:26 +02:00
parent 601d971147
commit 945f7e8fe0
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
2 changed files with 11 additions and 11 deletions

View File

@ -28,9 +28,9 @@ export let zIndex: number
let modalHTML: HTMLElement
let modalOHTML: HTMLElement
function close(ev: CustomEvent) {
console.log('got close, data', ev.detail)
if (onClose !== undefined) onClose(ev.detail)
function close(result: any) {
console.log('popup close result', result)
if (onClose !== undefined) onClose(result)
closePopup()
}
@ -65,12 +65,12 @@ $: {
<div class="popup" bind:this={modalHTML} style={`z-index: ${zIndex + 1};`}>
{#if typeof(is) === 'string'}
<Component is={is} props={props} on:close={close}/>
<Component is={is} props={props} on:close={ (ev) => close(ev.detail) }/>
{:else}
<svelte:component this={is} {...props} on:close={close} />
<svelte:component this={is} {...props} on:close={ (ev) => close(ev.detail) } />
{/if}
</div>
<div bind:this={modalOHTML} class="modal-overlay" style={`z-index: ${zIndex};`} on:click={close} />
<div bind:this={modalOHTML} class="modal-overlay" style={`z-index: ${zIndex};`} on:click={() => close(undefined)} />
<style lang="scss">
.popup {

View File

@ -42,14 +42,14 @@
}
</script>
<Dialog label={'Create Application'}
<!-- <Dialog label={'Create Application'}
okLabel={'Create Application'}
okAction={createCandidate}
on:close={() => { dispatch('close') }}>
<Section icon={File} label={'General Information'}>
on:close={() => { dispatch('close') }}> -->
<!-- <Section icon={File} label={'General Information'}> -->
<Grid>
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} show />
<DatePicker title={'Pick due date'} />
</Grid>
</Section>
</Dialog>
<!-- </Section> -->
<!-- </Dialog> -->