mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Exclude conditional elements
This commit is contained in:
@@ -78,7 +78,8 @@ export class HuiPictureElementsCardEditor
|
|||||||
private _handlePositionClick(x: number, y: number): void {
|
private _handlePositionClick(x: number, y: number): void {
|
||||||
if (
|
if (
|
||||||
!this._subElementEditorConfig?.elementConfig ||
|
!this._subElementEditorConfig?.elementConfig ||
|
||||||
this._subElementEditorConfig.type !== "element"
|
this._subElementEditorConfig.type !== "element" ||
|
||||||
|
this._subElementEditorConfig.elementConfig.type === "conditional"
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -178,7 +179,8 @@ export class HuiPictureElementsCardEditor
|
|||||||
|
|
||||||
if (this._subElementEditorConfig) {
|
if (this._subElementEditorConfig) {
|
||||||
return html`
|
return html`
|
||||||
${this._subElementEditorConfig.type === "element"
|
${this._subElementEditorConfig.type === "element" &&
|
||||||
|
this._subElementEditorConfig.elementConfig?.type !== "conditional"
|
||||||
? html`
|
? html`
|
||||||
<ha-alert alert-type="info">
|
<ha-alert alert-type="info">
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ export const getElementStubConfig = async (
|
|||||||
): Promise<LovelaceElementConfig> => {
|
): Promise<LovelaceElementConfig> => {
|
||||||
let elementConfig: LovelaceElementConfig = { type };
|
let elementConfig: LovelaceElementConfig = { type };
|
||||||
|
|
||||||
if (type !== "conditional") {
|
if (type === "conditional") {
|
||||||
|
elementConfig = { type, conditions: [], elements: [] };
|
||||||
|
} else {
|
||||||
elementConfig.style = { left: "50%", top: "50%" };
|
elementConfig.style = { left: "50%", top: "50%" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user