diff --git a/src/panels/lovelace/components/hui-card-options.ts b/src/panels/lovelace/components/hui-card-options.ts index 6f87fb30f0..826759cc1e 100644 --- a/src/panels/lovelace/components/hui-card-options.ts +++ b/src/panels/lovelace/components/hui-card-options.ts @@ -7,6 +7,7 @@ import { CSSResultGroup, html, LitElement, + nothing, PropertyValues, TemplateResult, } from "lit"; @@ -34,6 +35,8 @@ export class HuiCardOptions extends LitElement { @property() public path?: [number, number]; + @property({ type: Boolean }) public showPosition = false; + @queryAssignedNodes() private _assignedNodes?: NodeListOf; @storage({ @@ -68,7 +71,7 @@ export class HuiCardOptions extends LitElement { "ui.panel.lovelace.editor.edit_card.edit" )} -
+
-
- ${this.path![1] + 1} - ${this.hass!.localize( - "ui.panel.lovelace.editor.edit_card.position", - "position", - `${this.path![1] + 1}`, - "total", - `${this.lovelace!.config.views[this.path![0]].cards!.length}` - )} -
+ ${this.showPosition + ? html`
+ ${this.path![1] + 1} + ${this.hass!.localize( + "ui.panel.lovelace.editor.edit_card.position", + "position", + `${this.path![1] + 1}`, + "total", + `${ + this.lovelace!.config.views[this.path![0]].cards!.length + }` + )} +
` + : nothing}