mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 02:06:42 +00:00
Add ctrl/cmd +s support back to editor (#2694)
* Add ctrl/cmd +s support back to editor * Update hui-yaml-editor.ts
This commit is contained in:
parent
102cb06d28
commit
8938ad8f8d
@ -9,6 +9,7 @@ declare global {
|
||||
"yaml-changed": {
|
||||
value: string;
|
||||
};
|
||||
"yaml-save": undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +19,9 @@ export class HuiYamlEditor extends HTMLElement {
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
CodeMirror.commands.save = (cm: CodeMirror) => {
|
||||
fireEvent(cm.getWrapperElement(), "yaml-save");
|
||||
};
|
||||
this._value = "";
|
||||
const shadowRoot = this.attachShadow({ mode: "open" });
|
||||
shadowRoot.innerHTML = `
|
||||
|
@ -121,6 +121,7 @@ export class HuiEditCard extends LitElement {
|
||||
<hui-yaml-editor
|
||||
.value="${this._configValue!.value}"
|
||||
@yaml-changed="${this._handleYamlChanged}"
|
||||
@yaml-save="${this._save}"
|
||||
></hui-yaml-editor>
|
||||
`}
|
||||
</div>
|
||||
|
@ -61,7 +61,10 @@ class LovelaceFullConfigEditor extends LitElement {
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="content">
|
||||
<hui-yaml-editor @yaml-changed="${this._yamlChanged}">
|
||||
<hui-yaml-editor
|
||||
@yaml-changed="${this._yamlChanged}"
|
||||
@yaml-save="${this._handleSave}"
|
||||
>
|
||||
</hui-yaml-editor>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user