Use portal for modals

This commit is contained in:
Tusooa Zhu 2022-03-17 00:06:26 -04:00 committed by tusooa
parent 51ade26066
commit 39e4746f61
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
9 changed files with 114 additions and 108 deletions

View File

@ -74,8 +74,9 @@
</button>
</template>
</Popover>
<portal to="modal">
<confirm-modal
:showing="showingConfirmBlock"
v-if="showingConfirmBlock"
:title="$t('user_card.block_confirm_title')"
:confirm-text="$t('user_card.block_confirm_accept_button')"
:cancel-text="$t('user_card.block_confirm_cancel_button')"
@ -92,6 +93,7 @@
/>
</i18n>
</confirm-modal>
</portal>
</div>
</template>

View File

@ -11,12 +11,7 @@ const ConfirmModal = {
components: {
DialogModal
},
data: {
},
props: {
showing: {
type: Boolean
},
title: {
type: String
},

View File

@ -1,6 +1,5 @@
<template>
<dialog-modal
v-if="showing"
class="confirm-modal"
:on-cancel="onCancel"
>

View File

@ -76,8 +76,9 @@
</button>
</div>
</div>
<portal to="modal">
<confirm-modal
:showing="showingConfirmLogout"
v-if="showingConfirmLogout"
:title="$t('login.logout_confirm_title')"
:confirm-text="$t('login.logout_confirm_accept_button')"
:cancel-text="$t('login.logout_confirm_cancel_button')"
@ -86,6 +87,7 @@
>
{{ $t('login.logout_confirm') }}
</confirm-modal>
</portal>
</nav>
</template>
<script src="./desktop_nav.js"></script>

View File

@ -165,8 +165,9 @@
/>
</FALayers>
</span>
<portal to="modal">
<ConfirmModal
:showing="showingDeleteDialog"
v-if="showingDeleteDialog"
:title="$t('status.delete_confirm_title')"
:cancel-text="$t('status.delete_confirm_cancel_button')"
:confirm-text="$t('status.delete_confirm_accept_button')"
@ -175,6 +176,7 @@
>
{{ $t('status.delete_confirm') }}
</ConfirmModal>
</portal>
</template>
</Popover>
</template>

View File

@ -1,5 +1,4 @@
<template>
<div>
<button
class="btn button-default follow-button"
:class="{ toggled: isPressed }"
@ -8,9 +7,9 @@
@click="onClick"
>
{{ label }}
</button>
<portal to="modal">
<confirm-modal
:showing="showingConfirmUnfollow"
v-if="showingConfirmUnfollow"
:title="$t('user_card.unfollow_confirm_title')"
:confirm-text="$t('user_card.unfollow_confirm_accept_button')"
:cancel-text="$t('user_card.unfollow_confirm_cancel_button')"
@ -27,7 +26,8 @@
/>
</i18n>
</confirm-modal>
</div>
</portal>
</button>
</template>
<script src="./follow_button.js"></script>

View File

@ -88,8 +88,9 @@
ref="sideDrawer"
:logout="logout"
/>
<portal to="modal">
<confirm-modal
:showing="showingConfirmLogout"
v-if="showingConfirmLogout"
:title="$t('login.logout_confirm_title')"
:confirm-text="$t('login.logout_confirm_accept_button')"
:cancel-text="$t('login.logout_confirm_cancel_button')"
@ -98,6 +99,7 @@
>
{{ $t('login.logout_confirm') }}
</confirm-modal>
</portal>
</div>
</template>

View File

@ -59,8 +59,9 @@
>
{{ status.repeat_num }}
</span>
<portal to="modal">
<confirm-modal
:showing="showingConfirmDialog"
v-if="showingConfirmDialog"
:title="$t('status.repeat_confirm_title')"
:confirm-text="$t('status.repeat_confirm_accept_button')"
:cancel-text="$t('status.repeat_confirm_cancel_button')"
@ -69,6 +70,7 @@
>
{{ $t('status.repeat_confirm') }}
</confirm-modal>
</portal>
</div>
</template>

View File

@ -314,8 +314,9 @@
:handle-links="true"
/>
</div>
<portal to="modal">
<confirm-modal
:showing="showingConfirmMute"
v-if="showingConfirmMute"
:title="$t('user_card.mute_confirm_title')"
:confirm-text="$t('user_card.mute_confirm_accept_button')"
:cancel-text="$t('user_card.mute_confirm_cancel_button')"
@ -332,6 +333,7 @@
/>
</i18n>
</confirm-modal>
</portal>
</div>
</template>