mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16:39 +00:00
panel toggle for view UI Editor (#2628)
This commit is contained in:
parent
f1f1623d2f
commit
03f7a23540
@ -5,6 +5,7 @@ import {
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@polymer/paper-toggle-button/paper-toggle-button";
|
||||
|
||||
import { EditorTarget } from "../types";
|
||||
import { HomeAssistant } from "../../../../types";
|
||||
@ -55,6 +56,13 @@ export class HuiViewEditor extends LitElement {
|
||||
return this._config.theme || "Backend-selected";
|
||||
}
|
||||
|
||||
get _panel(): boolean {
|
||||
if (!this._config) {
|
||||
return false;
|
||||
}
|
||||
return this._config.panel || false;
|
||||
}
|
||||
|
||||
public hass?: HomeAssistant;
|
||||
private _config?: LovelaceViewConfig;
|
||||
|
||||
@ -94,6 +102,12 @@ export class HuiViewEditor extends LitElement {
|
||||
.configValue="${"theme"}"
|
||||
@theme-changed="${this._valueChanged}"
|
||||
></hui-theme-select-editor>
|
||||
<paper-toggle-button
|
||||
?checked="${this._panel !== false}"
|
||||
.configValue="${"panel"}"
|
||||
@change="${this._valueChanged}"
|
||||
>Panel Mode?</paper-toggle-button
|
||||
>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@ -114,7 +128,8 @@ export class HuiViewEditor extends LitElement {
|
||||
if (target.configValue) {
|
||||
newConfig = {
|
||||
...this._config,
|
||||
[target.configValue]: target.value,
|
||||
[target.configValue!]:
|
||||
target.checked !== undefined ? target.checked : target.value,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user