Muc-app: cleaning code.
This commit is contained in:
parent
074e688ed8
commit
86cac34ef3
@ -9,22 +9,17 @@ import { __ } from 'i18n'
|
|||||||
export function tplMUCNoteApp (el, mucModel) {
|
export function tplMUCNoteApp (el, mucModel) {
|
||||||
if (!mucModel) {
|
if (!mucModel) {
|
||||||
// should not happen
|
// should not happen
|
||||||
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
|
|
||||||
return html``
|
return html``
|
||||||
}
|
}
|
||||||
if (!mucModel.notes) {
|
if (!mucModel.notes) {
|
||||||
// too soon, not initialized yet (this will happen)
|
// 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``
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!el.show) {
|
if (!el.show) {
|
||||||
el.classList.add('hidden')
|
|
||||||
return html``
|
return html``
|
||||||
}
|
}
|
||||||
|
|
||||||
el.classList.remove('hidden')
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const i18nNotes = __(LOC_moderator_notes)
|
const i18nNotes = __(LOC_moderator_notes)
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
|
@ -9,22 +9,17 @@ import { __ } from 'i18n'
|
|||||||
export function tplMUCTaskApp (el, mucModel) {
|
export function tplMUCTaskApp (el, mucModel) {
|
||||||
if (!mucModel) {
|
if (!mucModel) {
|
||||||
// should not happen
|
// should not happen
|
||||||
el.classList.add('hidden') // we must do this, otherwise will have CSS side effects
|
|
||||||
return html``
|
return html``
|
||||||
}
|
}
|
||||||
if (!mucModel.tasklists) {
|
if (!mucModel.tasklists) {
|
||||||
// too soon, not initialized yet (this will happen)
|
// 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``
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!el.show) {
|
if (!el.show) {
|
||||||
el.classList.add('hidden')
|
|
||||||
return html``
|
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)
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
|
@ -51,6 +51,16 @@ export class MUCApp extends CustomElement {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updated () {
|
||||||
|
if (this.innerText.trim() === '') {
|
||||||
|
this.classList.add('hidden') // we must do this, otherwise will have CSS side effects
|
||||||
|
} else {
|
||||||
|
this.classList.remove('hidden')
|
||||||
|
}
|
||||||
|
|
||||||
|
super.updated()
|
||||||
|
}
|
||||||
|
|
||||||
toggleApp () {
|
toggleApp () {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
if (this.sessionStorangeShowKey) {
|
if (this.sessionStorangeShowKey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user