Skip to content

Commit 036cdde

Browse files
author
Marko Petzold
committed
refactor: clean up sizingSetup method
1 parent bc30bca commit 036cdde

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/widget-value.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { html, css, LitElement, PropertyValueMap } from 'lit'
22
import { repeat } from 'lit/directives/repeat.js'
3-
import { property, state } from 'lit/decorators.js'
3+
import { customElement, property, state } from 'lit/decorators.js'
44
import { InputData } from './definition-schema.js'
55

66
type Dataseries = Exclude<InputData['dataseries'], undefined>[number] & { needleValue?: number }
@@ -9,6 +9,8 @@ type Theme = {
99
theme_name: string
1010
theme_object: any
1111
}
12+
13+
@customElement('widget-value-versionplaceholder')
1214
export class WidgetValue extends LitElement {
1315
@property({ type: Object })
1416
inputData?: InputData
@@ -80,8 +82,6 @@ export class WidgetValue extends LitElement {
8082
}
8183

8284
sizingSetup() {
83-
if (this.origWidth !== 0 && this.origHeight !== 0) return
84-
8585
const boxes = Array.from(
8686
this?.shadowRoot?.querySelectorAll(
8787
'.sizing-container > .single-value'
@@ -388,5 +388,3 @@ export class WidgetValue extends LitElement {
388388
`
389389
}
390390
}
391-
392-
window.customElements.define('widget-value-versionplaceholder', WidgetValue)

0 commit comments

Comments
 (0)