@ -53,6 +53,11 @@ export default class MUCPollView extends CustomElement {
|
||||
body: '!' + choice.choice
|
||||
})
|
||||
}
|
||||
|
||||
closePoll (ev) {
|
||||
ev.preventDefault()
|
||||
this.model.set('current_poll', undefined)
|
||||
}
|
||||
}
|
||||
|
||||
api.elements.define('livechat-converse-muc-poll', MUCPollView)
|
||||
|
@ -71,7 +71,7 @@ converse.plugins.add('livechat-converse-poll', {
|
||||
return this.__super__.onMessage(attrs)
|
||||
}
|
||||
// We intercept poll messages, to show the banner.
|
||||
// Note: we also show the message in the chat.
|
||||
// Note: we also show poll end messages in the chat, so that the user don't loose the result.
|
||||
if (attrs.is_delayed || attrs.is_archived) {
|
||||
if (attrs.current_poll.over) {
|
||||
console.info('Got a delayed/archived poll message for an poll that is over, just displaying in the chat')
|
||||
|
@ -23,6 +23,12 @@
|
||||
padding-right: 0.25em;
|
||||
}
|
||||
|
||||
.livechat-poll-close {
|
||||
background: unset;
|
||||
border: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
p.livechat-poll-question {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
@ -82,6 +82,12 @@ export function tplPoll (el, currentPoll) {
|
||||
|
||||
return html`<div class="${currentPoll.over ? 'livechat-poll-over' : ''}">
|
||||
<p class="livechat-poll-question">
|
||||
${currentPoll.over
|
||||
? html`<button class="livechat-poll-close" @click=${el.closePoll} title="${__('Close')}">
|
||||
<converse-icon class="fa fa-times" size="1em"></converse-icon>
|
||||
</button>`
|
||||
: ''
|
||||
}
|
||||
${el.collapsed
|
||||
? html`
|
||||
<button @click=${el.toggle} class="livechat-poll-toggle">
|
||||
|
Reference in New Issue
Block a user