mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +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) {
|
||||
if (this._configElement?.refreshYamlEditor) {
|
||||
this._configElement.refreshYamlEditor(focus);
|
||||
}
|
||||
if (!this._yamlEditor?.codemirror) {
|
||||
return;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ export class HuiConditionalCardEditor extends LitElement
|
||||
this._config = cardConfigStruct(config);
|
||||
}
|
||||
|
||||
public refreshYamlEditor(focus) {
|
||||
this._cardEditorEl?.refreshYamlEditor(focus);
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this.hass || !this._config) {
|
||||
return html``;
|
||||
@ -195,7 +199,7 @@ export class HuiConditionalCardEditor extends LitElement
|
||||
private _setMode(value: boolean): void {
|
||||
this._GUImode = value;
|
||||
if (this._cardEditorEl) {
|
||||
this._cardEditorEl!.GUImode = value;
|
||||
this._cardEditorEl.GUImode = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,10 @@ export class HuiStackCardEditor extends LitElement
|
||||
this._config = cardConfigStruct(config);
|
||||
}
|
||||
|
||||
public refreshYamlEditor(focus) {
|
||||
this._cardEditorEl?.refreshYamlEditor(focus);
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this.hass || !this._config) {
|
||||
return html``;
|
||||
|
@ -57,4 +57,5 @@ export interface LovelaceCardEditor extends HTMLElement {
|
||||
hass?: HomeAssistant;
|
||||
lovelace?: LovelaceConfig;
|
||||
setConfig(config: LovelaceCardConfig): void;
|
||||
refreshYamlEditor?: (focus: boolean) => void;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user