mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Refresh card embedded yaml editors on dialog open (#6307)
This commit is contained in:
parent
06a94f0f28
commit
57c0b34ae9
@ -128,6 +128,9 @@ export class HuiCardEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public refreshYamlEditor(focus = false) {
|
public refreshYamlEditor(focus = false) {
|
||||||
|
if (this._configElement?.refreshYamlEditor) {
|
||||||
|
this._configElement.refreshYamlEditor(focus);
|
||||||
|
}
|
||||||
if (!this._yamlEditor?.codemirror) {
|
if (!this._yamlEditor?.codemirror) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,10 @@ export class HuiConditionalCardEditor extends LitElement
|
|||||||
this._config = cardConfigStruct(config);
|
this._config = cardConfigStruct(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public refreshYamlEditor(focus) {
|
||||||
|
this._cardEditorEl?.refreshYamlEditor(focus);
|
||||||
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.hass || !this._config) {
|
if (!this.hass || !this._config) {
|
||||||
return html``;
|
return html``;
|
||||||
@ -195,7 +199,7 @@ export class HuiConditionalCardEditor extends LitElement
|
|||||||
private _setMode(value: boolean): void {
|
private _setMode(value: boolean): void {
|
||||||
this._GUImode = value;
|
this._GUImode = value;
|
||||||
if (this._cardEditorEl) {
|
if (this._cardEditorEl) {
|
||||||
this._cardEditorEl!.GUImode = value;
|
this._cardEditorEl.GUImode = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@ export class HuiStackCardEditor extends LitElement
|
|||||||
this._config = cardConfigStruct(config);
|
this._config = cardConfigStruct(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public refreshYamlEditor(focus) {
|
||||||
|
this._cardEditorEl?.refreshYamlEditor(focus);
|
||||||
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.hass || !this._config) {
|
if (!this.hass || !this._config) {
|
||||||
return html``;
|
return html``;
|
||||||
|
@ -57,4 +57,5 @@ export interface LovelaceCardEditor extends HTMLElement {
|
|||||||
hass?: HomeAssistant;
|
hass?: HomeAssistant;
|
||||||
lovelace?: LovelaceConfig;
|
lovelace?: LovelaceConfig;
|
||||||
setConfig(config: LovelaceCardConfig): void;
|
setConfig(config: LovelaceCardConfig): void;
|
||||||
|
refreshYamlEditor?: (focus: boolean) => void;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user