Fix config dashboard scroll on desktop (#6242)

This commit is contained in:
Paulus Schoutsen 2020-06-26 12:05:54 -07:00 committed by GitHub
parent d55cb95479
commit 7395d19489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,8 @@ import { mdiCloudLock } from "@mdi/js";
class HaConfigDashboard extends LitElement {
@property() public hass!: HomeAssistant;
@property() public narrow!: boolean;
@property({ type: Boolean, reflect: true })
public narrow!: boolean;
@property() public isWide!: boolean;
@ -35,18 +36,10 @@ class HaConfigDashboard extends LitElement {
@property() public showAdvanced!: boolean;
protected render(): TemplateResult {
return html`
<app-header-layout has-scrolling-region>
<app-header fixed slot="header">
<app-toolbar>
<ha-menu-button
.hass=${this.hass}
const content = html` <ha-config-section
.narrow=${this.narrow}
></ha-menu-button>
</app-toolbar>
</app-header>
<ha-config-section .narrow=${this.narrow} .isWide=${this.isWide}>
.isWide=${this.isWide}
>
<div slot="header">
${this.hass.localize("ui.panel.config.header")}
</div>
@ -118,9 +111,7 @@ class HaConfigDashboard extends LitElement {
${!this.showAdvanced
? html`
<div class="promo-advanced">
${this.hass.localize(
"ui.panel.config.advanced_mode.hint_enable"
)}
${this.hass.localize("ui.panel.config.advanced_mode.hint_enable")}
<a href="/profile"
>${this.hass.localize(
"ui.panel.config.advanced_mode.link_profile_page"
@ -129,7 +120,24 @@ class HaConfigDashboard extends LitElement {
</div>
`
: ""}
</ha-config-section>
</ha-config-section>`;
if (!this.narrow) {
return content;
}
return html`
<app-header-layout has-scrolling-region>
<app-header fixed slot="header">
<app-toolbar>
<ha-menu-button
.hass=${this.hass}
.narrow=${this.narrow}
></ha-menu-button>
</app-toolbar>
</app-header>
${content}
</app-header-layout>
`;
}
@ -145,6 +153,9 @@ class HaConfigDashboard extends LitElement {
margin-bottom: 24px;
}
ha-config-section {
margin-top: -12px;
}
:host([narrow]) ha-config-section {
margin-top: -20px;
}
ha-card {