mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +00:00
Unused Entities: Only Show Fab when selection is made (#5248)
* Only Show Fab when selection is made * reviews
This commit is contained in:
parent
2741bb8b38
commit
8d0508f320
@ -47,7 +47,7 @@ export class HuiUnusedEntities extends LitElement {
|
|||||||
|
|
||||||
@property() private _unusedEntities: string[] = [];
|
@property() private _unusedEntities: string[] = [];
|
||||||
|
|
||||||
private _selectedEntities: string[] = [];
|
@property() private _selectedEntities: string[] = [];
|
||||||
|
|
||||||
private get _config(): LovelaceConfig {
|
private get _config(): LovelaceConfig {
|
||||||
return this.lovelace!.config;
|
return this.lovelace!.config;
|
||||||
@ -179,14 +179,20 @@ export class HuiUnusedEntities extends LitElement {
|
|||||||
@selection-changed=${this._handleSelectionChanged}
|
@selection-changed=${this._handleSelectionChanged}
|
||||||
></ha-data-table>
|
></ha-data-table>
|
||||||
|
|
||||||
<ha-fab
|
${this._selectedEntities.length
|
||||||
class="${classMap({
|
? html`
|
||||||
rtl: computeRTL(this.hass),
|
<ha-fab
|
||||||
})}"
|
class="${classMap({
|
||||||
icon="hass:plus"
|
rtl: computeRTL(this.hass),
|
||||||
label="${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")}"
|
})}"
|
||||||
@click="${this._addToLovelaceView}"
|
icon="hass:plus"
|
||||||
></ha-fab>
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.lovelace.editor.edit_card.add"
|
||||||
|
)}
|
||||||
|
@click=${this._addToLovelaceView}
|
||||||
|
></ha-fab>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user