Disable cloud expose controls when yaml filter (#6990)

This commit is contained in:
Bram Kragten
2020-09-15 08:42:09 +02:00
committed by GitHub
parent 183eff745d
commit 3bca32c6d5
3 changed files with 144 additions and 134 deletions

View File

@@ -1,17 +1,16 @@
import {
customElement,
html,
TemplateResult,
LitElement,
CSSResult,
css,
query,
property,
} from "lit-element";
import "@material/mwc-button";
import "@material/mwc-menu";
import type { Menu, Corner } from "@material/mwc-menu";
import type { Corner, Menu } from "@material/mwc-menu";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
query,
TemplateResult,
} from "lit-element";
import "./ha-icon-button";
@customElement("ha-button-menu")
@@ -22,6 +21,8 @@ export class HaButtonMenu extends LitElement {
@property({ type: Boolean }) public activatable = false;
@property({ type: Boolean }) public disabled = false;
@query("mwc-menu") private _menu?: Menu;
public get items() {
@@ -48,6 +49,9 @@ export class HaButtonMenu extends LitElement {
}
private _handleClick(): void {
if (this.disabled) {
return;
}
this._menu!.anchor = this;
this._menu!.show();
}