Task lists WIP:

* front-end: task are no more in a dialog
This commit is contained in:
John Livingston
2024-05-11 17:37:20 +02:00
parent 8aa12eb575
commit d6aefb61c4
13 changed files with 138 additions and 40 deletions

View File

@ -20,9 +20,9 @@ export function getHeadingButtons (view, buttons) {
i18n_text: __(LOC_tasks),
handler: async (ev) => {
ev.preventDefault()
ev.stopPropagation()
// opening the muc task lists view:
api.modal.show('livechat-converse-muc-task-lists-modal', { model: muc })
// opening or closing the muc task app:
const taskAppEl = ev.target.closest('converse-root').querySelector('livechat-converse-muc-task-app')
taskAppEl.toggleApp()
},
a_class: '',
icon_class: 'fa-list', // FIXME
@ -89,6 +89,11 @@ export function initOrDestroyChatRoomTaskLists (mucModel) {
return _destroyChatRoomTaskLists(mucModel)
}
if (!api.settings.get('livechat_task_list_enabled')) {
// Feature disabled, no need to handle tasks.
return _destroyChatRoomTaskLists(mucModel)
}
if (mucModel.session.get('connection_status') !== converse.ROOMSTATUS.ENTERED) {
return _destroyChatRoomTaskLists(mucModel)
}