mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Fix iframe aspect_ratio (#2004)
This commit is contained in:
parent
849d7d2d95
commit
23163b3095
@ -4,6 +4,7 @@ import "../../../components/ha-card";
|
||||
|
||||
import { LovelaceCard, LovelaceConfig } from "../types";
|
||||
import { TemplateResult } from "lit-html";
|
||||
import { styleMap } from "lit-html/directives/styleMap";
|
||||
|
||||
interface Config extends LovelaceConfig {
|
||||
aspect_ratio?: string;
|
||||
@ -37,10 +38,16 @@ export class HuiIframeCard extends LitElement implements LovelaceCard {
|
||||
return html``;
|
||||
}
|
||||
|
||||
const aspectRatio = this._config.aspect_ratio || "50%";
|
||||
|
||||
return html`
|
||||
${this.renderStyle()}
|
||||
<ha-card .header="${this._config.title}">
|
||||
<div id="root">
|
||||
<div id="root"
|
||||
style="${styleMap({
|
||||
"padding-top": aspectRatio,
|
||||
})}"
|
||||
>
|
||||
<iframe src="${this._config.url}"></iframe>
|
||||
</div>
|
||||
</ha-card>
|
||||
|
Loading…
x
Reference in New Issue
Block a user