diff --git a/src/panels/lovelace/cards/hui-iframe-card.ts b/src/panels/lovelace/cards/hui-iframe-card.ts index 63955f93dc7c..fa0ce0d93261 100644 --- a/src/panels/lovelace/cards/hui-iframe-card.ts +++ b/src/panels/lovelace/cards/hui-iframe-card.ts @@ -1,5 +1,6 @@ import { css, html, LitElement, nothing } from "lit"; import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { ifDefined } from "lit/directives/if-defined"; import { styleMap } from "lit/directives/style-map"; import parseAspectRatio from "../../../common/util/parse-aspect-ratio"; @@ -97,7 +98,10 @@ export class HuiIframeCard extends LitElement implements LovelaceCard { : `${sandbox_user_params} ${IFRAME_SANDBOX}`; return html` - +
`; @@ -65,8 +68,29 @@ export class HuiIframeCardEditor fireEvent(this, "config-changed", { config: ev.detail.value }); } - private _computeLabelCallback = (schema: SchemaUnion) => - this.hass!.localize(`ui.panel.lovelace.editor.card.generic.${schema.name}`); + private _computeLabelCallback = (schema: SchemaUnion) => { + switch (schema.name) { + case "hide_background": + return this.hass!.localize( + "ui.panel.lovelace.editor.card.iframe.hide_background" + ); + default: + return this.hass!.localize( + `ui.panel.lovelace.editor.card.generic.${schema.name}` + ); + } + }; + + private _computeHelperCallback = (schema: SchemaUnion) => { + switch (schema.name) { + case "hide_background": + return this.hass!.localize( + "ui.panel.lovelace.editor.card.iframe.hide_background_helper" + ); + default: + return ""; + } + }; } declare global { diff --git a/src/translations/en.json b/src/translations/en.json index 56fff0b2fe59..f77753e759ef 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -7778,7 +7778,9 @@ }, "iframe": { "name": "Webpage", - "description": "The Webpage card allows you to embed your favorite webpage right into Home Assistant." + "description": "The Webpage card allows you to embed your favorite webpage right into Home Assistant.", + "hide_background": "Hide background", + "hide_background_helper": "Useful for pages which allow a transparent background." }, "light": { "name": "Light",