Cleaning more stuff.
This commit is contained in:
committed by
Mehdi Benadel
parent
b72b23d6ae
commit
1d14bbbda0
@ -57,6 +57,7 @@ interface CellDataSchema {
|
||||
}
|
||||
|
||||
@customElement('livechat-dynamic-table-form')
|
||||
// FIXME: use LivechatElement instead of LitElement? If so, be carefull about createRenderRoot
|
||||
export class DynamicTableFormElement extends LitElement {
|
||||
|
||||
@property({ attribute: false })
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { html, LitElement } from 'lit'
|
||||
import { html } from 'lit'
|
||||
import { customElement, property, state } from 'lit/decorators.js'
|
||||
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
||||
import { helpButtonSVG } from '../../../videowatch/buttons'
|
||||
@ -9,9 +9,10 @@ import { Task } from '@lit/task'
|
||||
import { localizedHelpUrl } from '../../../utils/help'
|
||||
import { ptTr } from '../directives/translation'
|
||||
import { DirectiveResult } from 'lit/directive'
|
||||
import { LivechatElement } from './livechat'
|
||||
|
||||
@customElement('livechat-help-button')
|
||||
export class HelpButtonElement extends LitElement {
|
||||
export class HelpButtonElement extends LivechatElement {
|
||||
|
||||
@consume({ context: registerClientOptionsContext, subscribe: true })
|
||||
public registerClientOptions: RegisterClientOptions | undefined
|
||||
@ -25,10 +26,6 @@ export class HelpButtonElement extends LitElement {
|
||||
@state()
|
||||
public url: URL = new URL('https://lmddgtfy.net/')
|
||||
|
||||
protected createRenderRoot = (): HTMLElement | DocumentFragment => {
|
||||
return this
|
||||
}
|
||||
|
||||
private _asyncTaskRender = new Task(this, {
|
||||
task: async ([registerClientOptions], {signal}) => {
|
||||
this.url = new URL(registerClientOptions ? await localizedHelpUrl(registerClientOptions, { page: this.page }) : '')
|
||||
|
10
client/common/lib/elements/livechat.ts
Normal file
10
client/common/lib/elements/livechat.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { LitElement } from 'lit'
|
||||
|
||||
/**
|
||||
* Base class for all Custom Elements.
|
||||
*/
|
||||
export class LivechatElement extends LitElement {
|
||||
protected createRenderRoot = (): HTMLElement | DocumentFragment => {
|
||||
return this
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user