popupの制御を出す側で行うように

This commit is contained in:
kakkokari-gtyih
2024-07-15 11:53:32 +09:00
parent 8d144c8fdc
commit 87a7d1a8ea
10 changed files with 52 additions and 52 deletions

View File

@@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="{ [$style.done]: closed || isVoted }">
<div :class="{ [$style.done]: closed || isVoted || readOnly }">
<ul :class="$style.choices">
<li v-for="(choice, i) in poll.choices" :key="i" :class="$style.choice" @click="vote(i)">
<div :class="$style.bg" :style="{ 'width': `${showResult ? (choice.votes / total * 100) : 0}%` }"></div>
@@ -83,10 +83,10 @@ if (props.poll.expiresAt) {
}
const vote = async (id) => {
pleaseLogin(undefined, pleaseLoginContext.value);
if (props.readOnly || closed.value || isVoted.value) return;
pleaseLogin(undefined, pleaseLoginContext.value);
const { canceled } = await os.confirm({
type: 'question',
text: i18n.tsx.voteConfirm({ choice: props.poll.choices[id].text }),
@@ -145,7 +145,7 @@ const vote = async (id) => {
.done {
.choice {
cursor: default;
cursor: initial;
}
}
</style>