Custom channel emoticons WIP (#130): fix CSS

This commit is contained in:
John Livingston
2024-06-07 14:08:35 +02:00
parent f1cf98921f
commit 92cf83dcdf
5 changed files with 16 additions and 7 deletions

View File

@ -46,7 +46,7 @@ export class ChannelEmojisElement extends LivechatElement {
url: {
colName: ptTr(LOC_LIVECHAT_EMOJIS_FILE),
description: ptTr(LOC_LIVECHAT_EMOJIS_FILE_DESC),
headerClassList: ['peertube-livechat-emojis-thead-file']
headerClassList: ['peertube-livechat-emojis-col-file']
}
}
const tableSchema: DynamicFormSchema = {
@ -56,7 +56,8 @@ export class ChannelEmojisElement extends LivechatElement {
},
url: {
inputType: 'image-file',
default: ''
default: '',
colClassList: ['peertube-livechat-emojis-col-file']
}
}
return this._asyncTaskRender.render({

View File

@ -70,6 +70,7 @@ interface CellDataSchema {
separators?: string[]
inputType?: DynamicTableAcceptedInputTypes
default?: DynamicTableAcceptedTypes
colClassList?: string[] // CSS classes to add to the <td> element.
}
interface DynamicTableRowData {
@ -460,7 +461,11 @@ export class DynamicTableFormElement extends LivechatElement {
`with field type '${propertySchema.inputType as string}' for form entry '${propertyName.toString()}'.`)
}
return html`<td class="form-group">${formElement}</td>`
const classList = ['form-group']
if (propertySchema.colClassList) {
classList.push(...propertySchema.colClassList)
}
return html`<td class=${classList.join(' ')}>${formElement}</td>`
}
_renderInput = (rowId: number,