peertube-plugin-livechat/conversejs/custom/plugins/tasks/muc-task-lists-view.js

28 lines
725 B
JavaScript
Raw Normal View History

2024-04-30 07:21:18 +00:00
import { CustomElement } from 'shared/components/element.js'
2024-04-30 16:30:44 +00:00
import { api } from '@converse/headless/core'
2024-04-30 15:11:10 +00:00
import tplMucTaskLists from './templates/muc-task-lists'
2024-04-30 07:21:18 +00:00
export default class MUCTaskListsView extends CustomElement {
static get properties () {
return {
2024-04-30 16:30:44 +00:00
model: { type: Object, attribute: true }
2024-04-30 07:21:18 +00:00
}
}
async initialize () {
2024-04-30 15:11:10 +00:00
if (!this.model) {
return
}
2024-04-30 16:30:44 +00:00
// Adding or removing a new task list: we must update.
2024-04-30 15:11:10 +00:00
this.listenTo(this.model, 'add', () => this.requestUpdate())
2024-04-30 16:30:44 +00:00
this.listenTo(this.model, 'remove', () => this.requestUpdate())
2024-04-30 07:21:18 +00:00
}
render () {
2024-04-30 15:11:10 +00:00
return tplMucTaskLists(this.model)
2024-04-30 07:21:18 +00:00
}
}
api.elements.define('livechat-converse-muc-task-lists', MUCTaskListsView)