Task lists WIP:

* responsive for the task app
This commit is contained in:
John Livingston 2024-05-12 15:38:11 +02:00
parent 0c4a5999f8
commit 5c9733147b
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 24 additions and 7 deletions

View File

@ -30,4 +30,13 @@
overflow-y: auto; overflow-y: auto;
} }
} }
&[livechat-converse-root-width="small"],
&[livechat-converse-root-width="medium"] {
converse-muc-chatarea livechat-converse-muc-task-app:not(.hidden) ~ * {
// on small and medium width, we hide all subsequent siblings of the task app
// (when app is not hidden)
display: none !important;
}
}
} }

View File

@ -2,22 +2,30 @@ import { html } from 'lit'
import { __ } from 'i18n' import { __ } from 'i18n'
export function tplMUCTaskApp (el, mucModel) { export function tplMUCTaskApp (el, mucModel) {
if (!mucModel) { return html`` } // should not happen if (!mucModel) {
if (!mucModel.tasklists) { return html`` } // too soon, not initialized. // should not happen
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
if (!el.show) { return html``
el.style.display = 'none' }
if (!mucModel.tasklists) {
// too soon, not initialized yet (this will happen)
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
return html`` return html``
} }
el.style.display = '' if (!el.show) {
el.classList.add('hidden')
return html``
}
el.classList.remove('hidden')
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const i18nTasks = __(LOC_tasks) const i18nTasks = __(LOC_tasks)
return html` return html`
<div class="livechat-converse-muc-app-header"> <div class="livechat-converse-muc-app-header">
<h5>${i18nTasks}</h5> <h5>${i18nTasks}</h5>
<button class="livechat-converse-muc-app-close" @click=${el.toggleApp}> <button class="livechat-converse-muc-app-close" @click=${el.toggleApp} title="${__('Close')}">
<converse-icon class="fa fa-times" size="1em"></converse-icon> <converse-icon class="fa fa-times" size="1em"></converse-icon>
</button> </button>
</div> </div>