commit: 39e4746f615970001839309e06a0f13d9613b175 parent 51ade260660b1a6586b5c0091d89c9701b684870 Author: Tusooa Zhu <tusooa@kazv.moe> Date: Thu, 17 Mar 2022 00:06:26 -0400 Use portal for modalsDiffstat:
M | src/components/account_actions/account_actions.vue | 36 | +++++++++++++++++++----------------- |
M | src/components/confirm_modal/confirm_modal.js | 5 | ----- |
M | src/components/confirm_modal/confirm_modal.vue | 1 | - |
M | src/components/desktop_nav/desktop_nav.vue | 22 | ++++++++++++---------- |
M | src/components/extra_buttons/extra_buttons.vue | 22 | ++++++++++++---------- |
M | src/components/follow_button/follow_button.vue | 56 | ++++++++++++++++++++++++++++---------------------------- |
M | src/components/mobile_nav/mobile_nav.vue | 22 | ++++++++++++---------- |
M | src/components/retweet_button/retweet_button.vue | 22 | ++++++++++++---------- |
M | src/components/user_card/user_card.vue | 36 | +++++++++++++++++++----------------- |
9 files changed, 114 insertions(+), 108 deletions(-)diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue
@@ -74,24 +74,26 @@ </button> </template> </Popover> - <confirm-modal - :showing="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')" - @accepted="doBlockUser" - @cancelled="hideConfirmBlock" - > - <i18n - path="user_card.block_confirm" - tag="span" + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doBlockUser" + @cancelled="hideConfirmBlock" > - <span - place="user" - v-text="user.screen_name_ui" - /> - </i18n> - </confirm-modal> + <i18n + path="user_card.block_confirm" + tag="span" + > + <span + place="user" + v-text="user.screen_name_ui" + /> + </i18n> + </confirm-modal> + </portal> </div> </template>diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js
@@ -11,12 +11,7 @@ const ConfirmModal = { components: { DialogModal }, - data: { - }, props: { - showing: { - type: Boolean - }, title: { type: String },diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue
@@ -1,6 +1,5 @@ <template> <dialog-modal - v-if="showing" class="confirm-modal" :on-cancel="onCancel" >diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
@@ -76,16 +76,18 @@ </button> </div> </div> - <confirm-modal - :showing="showingConfirmLogout" - :title="$t('login.logout_confirm_title')" - :confirm-text="$t('login.logout_confirm_accept_button')" - :cancel-text="$t('login.logout_confirm_cancel_button')" - @accepted="doLogout" - @cancelled="hideConfirmLogout" - > - {{ $t('login.logout_confirm') }} - </confirm-modal> + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doLogout" + @cancelled="hideConfirmLogout" + > + {{ $t('login.logout_confirm') }} + </confirm-modal> + </portal> </nav> </template> <script src="./desktop_nav.js"></script>diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
@@ -165,16 +165,18 @@ /> </FALayers> </span> - <ConfirmModal - :showing="showingDeleteDialog" - :title="$t('status.delete_confirm_title')" - :cancel-text="$t('status.delete_confirm_cancel_button')" - :confirm-text="$t('status.delete_confirm_accept_button')" - @cancelled="hideDeleteStatusConfirmDialog" - @accepted="doDeleteStatus" - > - {{ $t('status.delete_confirm') }} - </ConfirmModal> + <portal to="modal"> + <ConfirmModal + 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')" + @cancelled="hideDeleteStatusConfirmDialog" + @accepted="doDeleteStatus" + > + {{ $t('status.delete_confirm') }} + </ConfirmModal> + </portal> </template> </Popover> </template>diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
@@ -1,33 +1,33 @@ <template> - <div> - <button - class="btn button-default follow-button" - :class="{ toggled: isPressed }" - :disabled="disabled" - :title="title" - @click="onClick" - > - {{ label }} - </button> - <confirm-modal - :showing="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')" - @accepted="doUnfollow" - @cancelled="hideConfirmUnfollow" - > - <i18n - path="user_card.unfollow_confirm" - tag="span" + <button + class="btn button-default follow-button" + :class="{ toggled: isPressed }" + :disabled="disabled" + :title="title" + @click="onClick" + > + {{ label }} + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doUnfollow" + @cancelled="hideConfirmUnfollow" > - <span - place="user" - v-text="user.screen_name_ui" - /> - </i18n> - </confirm-modal> - </div> + <i18n + path="user_card.unfollow_confirm" + tag="span" + > + <span + place="user" + v-text="user.screen_name_ui" + /> + </i18n> + </confirm-modal> + </portal> + </button> </template> <script src="./follow_button.js"></script>diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
@@ -88,16 +88,18 @@ ref="sideDrawer" :logout="logout" /> - <confirm-modal - :showing="showingConfirmLogout" - :title="$t('login.logout_confirm_title')" - :confirm-text="$t('login.logout_confirm_accept_button')" - :cancel-text="$t('login.logout_confirm_cancel_button')" - @accepted="doLogout" - @cancelled="hideConfirmLogout" - > - {{ $t('login.logout_confirm') }} - </confirm-modal> + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doLogout" + @cancelled="hideConfirmLogout" + > + {{ $t('login.logout_confirm') }} + </confirm-modal> + </portal> </div> </template>diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue
@@ -59,16 +59,18 @@ > {{ status.repeat_num }} </span> - <confirm-modal - :showing="showingConfirmDialog" - :title="$t('status.repeat_confirm_title')" - :confirm-text="$t('status.repeat_confirm_accept_button')" - :cancel-text="$t('status.repeat_confirm_cancel_button')" - @accepted="doRetweet" - @cancelled="hideConfirmDialog" - > - {{ $t('status.repeat_confirm') }} - </confirm-modal> + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doRetweet" + @cancelled="hideConfirmDialog" + > + {{ $t('status.repeat_confirm') }} + </confirm-modal> + </portal> </div> </template>diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
@@ -314,24 +314,26 @@ :handle-links="true" /> </div> - <confirm-modal - :showing="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')" - @accepted="doMuteUser" - @cancelled="hideConfirmMute" - > - <i18n - path="user_card.mute_confirm" - tag="span" + <portal to="modal"> + <confirm-modal + 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')" + @accepted="doMuteUser" + @cancelled="hideConfirmMute" > - <span - place="user" - v-text="user.screen_name_ui" - /> - </i18n> - </confirm-modal> + <i18n + path="user_card.mute_confirm" + tag="span" + > + <span + place="user" + v-text="user.screen_name_ui" + /> + </i18n> + </confirm-modal> + </portal> </div> </template>