diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index b9c67a8a..4bab363b 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -66,24 +66,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 index bb5e9d97..96ddc118 100644 --- 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 index 59e46dc1..5b5014c5 100644 --- 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 index 3e6c296c..af12a98d 100644 --- a/src/components/desktop_nav/desktop_nav.vue +++ b/src/components/desktop_nav/desktop_nav.vue @@ -64,7 +64,7 @@ <button v-if="currentUser" class="button-unstyled nav-icon" - @click.prevent="logout" + @click.prevent.stop="logout" > <FAIcon fixed-width @@ -75,16 +75,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 index 4eb566a3..715e93ac 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -125,16 +125,18 @@ icon="ellipsis-h" /> </button> - <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 index 4fc2233a..5c799406 100644 --- 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 index 6b010310..9d9c6e47 100644 --- a/src/components/mobile_nav/mobile_nav.vue +++ b/src/components/mobile_nav/mobile_nav.vue @@ -81,16 +81,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 index cebc8784..977116b3 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -33,16 +33,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 index 1ed0ea98..fd51b09f 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -279,24 +279,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>