diff --git a/src/panels/lovelace/cards/hui-iframe-card.ts b/src/panels/lovelace/cards/hui-iframe-card.ts index dd4304e1a5..30a226848d 100644 --- a/src/panels/lovelace/cards/hui-iframe-card.ts +++ b/src/panels/lovelace/cards/hui-iframe-card.ts @@ -31,9 +31,6 @@ export class HuiIframeCard extends LitElement implements LovelaceCard { @property({ type: Boolean, reflect: true }) public isPanel = false; - @property({ type: Boolean, reflect: true }) - public editMode = false; - @property() protected _config?: IframeCardConfig; public getCardSize(): number { @@ -94,10 +91,6 @@ export class HuiIframeCard extends LitElement implements LovelaceCard { height: 100%; } - :host([ispanel][editMode]) ha-card { - height: calc(100% - 51px); - } - ha-card { overflow: hidden; } diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index bc54ec2a52..9683445600 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -72,9 +72,6 @@ class HuiMapCard extends LitElement implements LovelaceCard { @property({ type: Boolean, reflect: true }) public isPanel = false; - @property({ type: Boolean, reflect: true }) - public editMode = false; - @property() private _history?: HassEntity[][]; @@ -658,10 +655,6 @@ class HuiMapCard extends LitElement implements LovelaceCard { static get styles(): CSSResult { return css` - :host([ispanel][editMode]) ha-card { - height: calc(100% - 51px); - } - ha-card { overflow: hidden; width: 100%; diff --git a/src/panels/lovelace/components/hui-card-options.ts b/src/panels/lovelace/components/hui-card-options.ts index a921a130d7..c627c3b838 100644 --- a/src/panels/lovelace/components/hui-card-options.ts +++ b/src/panels/lovelace/components/hui-card-options.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + PropertyValues, queryAssignedNodes, TemplateResult, } from "lit-element"; @@ -39,9 +40,19 @@ export class HuiCardOptions extends LitElement { return this._assignedNodes ? computeCardSize(this._assignedNodes[0]) : 1; } + protected updated(changedProps: PropertyValues) { + if (!changedProps.has("path") || !this.path) { + return; + } + this.classList.toggle( + "panel", + this.lovelace!.config.views[this.path![0]].panel + ); + } + protected render(): TemplateResult { return html` - +