From e936a9b7c26c33f1123dee710ff25c84c74e815d Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 11 Oct 2019 18:42:13 +0200 Subject: [PATCH] Update weather-card-editor.js --- dist/weather-card-editor.js | 94 +++++++++++++++---------------------- 1 file changed, 38 insertions(+), 56 deletions(-) diff --git a/dist/weather-card-editor.js b/dist/weather-card-editor.js index eef23591..e3d14216 100644 --- a/dist/weather-card-editor.js +++ b/dist/weather-card-editor.js @@ -11,8 +11,16 @@ const fireEvent = (node, type, detail, options) => { return event; }; +if ( + !customElements.get("ha-switch") && + customElements.get("paper-toggle-button") +) { + customElements.define("ha-switch", customElements.get("paper-toggle-button")); +} + const LitElement = Object.getPrototypeOf(customElements.get("hui-view")); const html = LitElement.prototype.html; +const css = LitElement.prototype.css; export class WeatherCardEditor extends LitElement { setConfig(config) { @@ -57,7 +65,6 @@ export class WeatherCardEditor extends LitElement { ); return html` - ${this.renderStyle()}
`} - ${customElements.get("paper-toggle-button") - ? html` - Show current - Show details - Show forecast - ` - : html` - Show current - Show details - Show forecast - `} + Show current + Show details + Show forecast
`; @@ -169,20 +153,18 @@ export class WeatherCardEditor extends LitElement { fireEvent(this, "config-changed", { config: this._config }); } - renderStyle() { - return html` - + static get styles() { + return css` + ha-switch { + padding-top: 16px; + } + .side-by-side { + display: flex; + } + .side-by-side > * { + flex: 1; + padding-right: 4px; + } `; } }