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