mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Glance height fix (Again): A row could be zero height (#6110)
This commit is contained in:
parent
81277fd12e
commit
0fcedc5046
@ -66,17 +66,15 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
||||
private _configEntities?: GlanceConfigEntity[];
|
||||
|
||||
public getCardSize(): number {
|
||||
return (
|
||||
(this._config!.title ? 1 : 0) +
|
||||
Math.max(
|
||||
((this._config!.show_icon ? 1 : 0) +
|
||||
(this._config!.show_name && this._config!.show_state ? 1 : 0)) *
|
||||
Math.ceil(
|
||||
this._configEntities!.length / (this._config!.columns || 5)
|
||||
),
|
||||
1
|
||||
)
|
||||
const rowHeight =
|
||||
(this._config!.show_icon ? 1 : 0) +
|
||||
(this._config!.show_name && this._config!.show_state ? 1 : 0) || 1;
|
||||
|
||||
const numRows = Math.ceil(
|
||||
this._configEntities!.length / (this._config!.columns || 5)
|
||||
);
|
||||
|
||||
return (this._config!.title ? 1 : 0) + rowHeight * numRows;
|
||||
}
|
||||
|
||||
public setConfig(config: GlanceCardConfig): void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user