destroy entire dialog when closed

This commit is contained in:
Nolan Lawson 2018-04-04 20:33:17 -07:00
parent 8d6cb56421
commit 5a23235529
8 changed files with 50 additions and 12 deletions

View file

@ -1,4 +1,11 @@
<ModalDialog :label :shown :closed :title background="var(--main-bg)">
<ModalDialog
:label
:shown
:closed
:title
background="var(--main-bg)"
on:destroyDialog="destroy()"
>
<ComposeBox realm="dialog" size="slim" autoFocus="true" on:postedStatus="onPostedStatus()" />
</ModalDialog>
<script>

View file

@ -1,4 +1,10 @@
<ModalDialog :label :shown :closed background="var(--main-bg)" on:close="onClose()">
<ModalDialog
:label
:shown
:closed background="var(--main-bg)"
on:close="onClose()"
on:destroyDialog="destroy()"
>
<form class="confirmation-dialog-form">
<p>
{{text}}

View file

@ -1,4 +1,11 @@
<ModalDialog :label :shown :closed :title background="var(--main-bg)">
<ModalDialog
:label
:shown
:closed
:title
background="var(--main-bg)"
on:destroyDialog="destroy()"
>
<div class="custom-emoji-container">
{{#if emojis.length}}
<ul class="custom-emoji-list">

View file

@ -3,6 +3,7 @@
background="var(--muted-modal-bg)"
muted="true"
className="image-modal-dialog"
on:destroyDialog="destroy()"
>
{{#if type === 'gifv'}}
<AutoplayVideo

View file

@ -148,8 +148,9 @@
a11yDialog.on('hide', () => {
a11yDialog.destroy()
this.fire('close')
this.destroy()
document.body.removeChild(dialogElement)
console.log('destroyDialog()')
this.fire('destroyDialog')
requestAnimationFrame(() => document.body.removeChild(dialogElement))
})
this.observe('shown', shown => {
if (shown) {

View file

@ -1,4 +1,11 @@
<ModalDialog :label :shown :closed :title background="var(--main-bg)">
<ModalDialog
:label
:shown
:closed
:title
background="var(--main-bg)"
on:destroyDialog="destroy()"
>
<GenericDialogList :items on:click="onClick(event)" />
</ModalDialog>
<script>

View file

@ -1,4 +1,11 @@
<ModalDialog :label :shown :closed :title background="var(--main-bg)">
<ModalDialog
:label
:shown
:closed
:title
background="var(--main-bg)"
on:destroyDialog="destroy()"
>
<GenericDialogList :items on:click="onClick(event)"/>
</ModalDialog>
<script>

View file

@ -1,8 +1,10 @@
<ModalDialog :label
:shown
background="var(--muted-modal-bg)"
muted="true"
className="video-modal-dialog"
<ModalDialog
:label
:shown
background="var(--muted-modal-bg)"
muted="true"
className="video-modal-dialog"
on:destroyDialog="destroy()"
>
<video poster="{{poster}}"
src="{{src}}"