mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Move save to the instance
This commit is contained in:
parent
95e9d6164d
commit
e789380126
@ -19,9 +19,6 @@ export class HuiYamlEditor extends HTMLElement {
|
|||||||
|
|
||||||
public constructor() {
|
public constructor() {
|
||||||
super();
|
super();
|
||||||
CodeMirror.commands.save = () => {
|
|
||||||
fireEvent(this, "yaml-save");
|
|
||||||
};
|
|
||||||
this._value = "";
|
this._value = "";
|
||||||
const shadowRoot = this.attachShadow({ mode: "open" });
|
const shadowRoot = this.attachShadow({ mode: "open" });
|
||||||
shadowRoot.innerHTML = `
|
shadowRoot.innerHTML = `
|
||||||
@ -77,6 +74,9 @@ export class HuiYamlEditor extends HTMLElement {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
this.codemirror.commands.save = () => {
|
||||||
|
fireEvent(this, "yaml-save");
|
||||||
|
};
|
||||||
fireEvent(this, "yaml-changed", { value: this._value });
|
fireEvent(this, "yaml-changed", { value: this._value });
|
||||||
this.codemirror.on("changes", () => this._onChange());
|
this.codemirror.on("changes", () => this._onChange());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user