Poll WIP (#231):

* frontend improvement
This commit is contained in:
John Livingston 2024-07-04 17:49:28 +02:00
parent 6f7c5c50f7
commit 0983c8ed57
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
3 changed files with 14 additions and 2 deletions

View File

@ -33,7 +33,8 @@ export default class MUCPollView extends CustomElement {
return tplPoll(this, currentPoll) return tplPoll(this, currentPoll)
} }
toggle () { toggle (ev) {
ev.preventDefault()
this.collapsed = !this.collapsed this.collapsed = !this.collapsed
} }

View File

@ -30,6 +30,10 @@
p.livechat-poll-question { p.livechat-poll-question {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
span {
cursor: pointer; // because a click toggles
}
} }
p.livechat-poll-instructions { p.livechat-poll-instructions {
@ -120,6 +124,11 @@ body[livechat-viewer-mode="on"] {
// stop showing poll when over in readonly mode // stop showing poll when over in readonly mode
display: none !important; display: none !important;
} }
p.livechat-poll-instructions {
// No need for instruction in readonly mode
display: none !important;
}
} }
} }
} }

View File

@ -104,7 +104,9 @@ export function tplPoll (el, currentPoll) {
size="1em"></converse-icon> size="1em"></converse-icon>
</button>` </button>`
} }
${currentPoll.question} <span @click=${el.toggle}>
${currentPoll.question}
</span>
</p> </p>
${ ${
el.collapsed el.collapsed