mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16: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[] = [];
|
||||
|
||||
private _selectedEntities: string[] = [];
|
||||
@property() private _selectedEntities: string[] = [];
|
||||
|
||||
private get _config(): LovelaceConfig {
|
||||
return this.lovelace!.config;
|
||||
@ -179,14 +179,20 @@ export class HuiUnusedEntities extends LitElement {
|
||||
@selection-changed=${this._handleSelectionChanged}
|
||||
></ha-data-table>
|
||||
|
||||
<ha-fab
|
||||
class="${classMap({
|
||||
rtl: computeRTL(this.hass),
|
||||
})}"
|
||||
icon="hass:plus"
|
||||
label="${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")}"
|
||||
@click="${this._addToLovelaceView}"
|
||||
></ha-fab>
|
||||
${this._selectedEntities.length
|
||||
? html`
|
||||
<ha-fab
|
||||
class="${classMap({
|
||||
rtl: computeRTL(this.hass),
|
||||
})}"
|
||||
icon="hass:plus"
|
||||
.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