From 0983c8ed57b2878207dc954240169ecdf4734f06 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Thu, 4 Jul 2024 17:49:28 +0200 Subject: [PATCH] Poll WIP (#231): * frontend improvement --- conversejs/custom/plugins/poll/components/poll-view.js | 3 ++- conversejs/custom/plugins/poll/styles/poll.scss | 9 +++++++++ conversejs/custom/plugins/poll/templates/poll.js | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/conversejs/custom/plugins/poll/components/poll-view.js b/conversejs/custom/plugins/poll/components/poll-view.js index 8742f044..422aba72 100644 --- a/conversejs/custom/plugins/poll/components/poll-view.js +++ b/conversejs/custom/plugins/poll/components/poll-view.js @@ -33,7 +33,8 @@ export default class MUCPollView extends CustomElement { return tplPoll(this, currentPoll) } - toggle () { + toggle (ev) { + ev.preventDefault() this.collapsed = !this.collapsed } diff --git a/conversejs/custom/plugins/poll/styles/poll.scss b/conversejs/custom/plugins/poll/styles/poll.scss index be5700d5..1f4248f9 100644 --- a/conversejs/custom/plugins/poll/styles/poll.scss +++ b/conversejs/custom/plugins/poll/styles/poll.scss @@ -30,6 +30,10 @@ p.livechat-poll-question { text-align: center; font-weight: bold; + + span { + cursor: pointer; // because a click toggles + } } p.livechat-poll-instructions { @@ -120,6 +124,11 @@ body[livechat-viewer-mode="on"] { // stop showing poll when over in readonly mode display: none !important; } + + p.livechat-poll-instructions { + // No need for instruction in readonly mode + display: none !important; + } } } } diff --git a/conversejs/custom/plugins/poll/templates/poll.js b/conversejs/custom/plugins/poll/templates/poll.js index e4367126..bd976b6d 100644 --- a/conversejs/custom/plugins/poll/templates/poll.js +++ b/conversejs/custom/plugins/poll/templates/poll.js @@ -104,7 +104,9 @@ export function tplPoll (el, currentPoll) { size="1em"> ` } - ${currentPoll.question} + + ${currentPoll.question} +

${ el.collapsed