mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36: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[];
|
private _configEntities?: GlanceConfigEntity[];
|
||||||
|
|
||||||
public getCardSize(): number {
|
public getCardSize(): number {
|
||||||
return (
|
const rowHeight =
|
||||||
(this._config!.title ? 1 : 0) +
|
(this._config!.show_icon ? 1 : 0) +
|
||||||
Math.max(
|
(this._config!.show_name && this._config!.show_state ? 1 : 0) || 1;
|
||||||
((this._config!.show_icon ? 1 : 0) +
|
|
||||||
(this._config!.show_name && this._config!.show_state ? 1 : 0)) *
|
const numRows = Math.ceil(
|
||||||
Math.ceil(
|
this._configEntities!.length / (this._config!.columns || 5)
|
||||||
this._configEntities!.length / (this._config!.columns || 5)
|
|
||||||
),
|
|
||||||
1
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return (this._config!.title ? 1 : 0) + rowHeight * numRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setConfig(config: GlanceCardConfig): void {
|
public setConfig(config: GlanceCardConfig): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user