Unused Entities: Only Show Fab when selection is made (#5248)

* Only Show Fab when selection is made

* reviews
This commit is contained in:
Zack Arnett 2020-03-18 15:33:36 -04:00 committed by GitHub
parent 2741bb8b38
commit 8d0508f320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>
`
: ""}
`;
}