From 6911df9ac487c4bda504f6a9badea557a21ebcb3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 30 Jun 2019 21:55:29 -0700 Subject: [PATCH] Fix sidebar in Safari --- src/components/ha-sidebar.ts | 165 +++++++++++++++++++---------------- 1 file changed, 91 insertions(+), 74 deletions(-) diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index 341892caf2..281eae4aaa 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -149,84 +149,92 @@ class HaSidebar extends LitElement { : ""} Home Assistant - - - + - - - ${hass.localize("panel.states")} - - + + + + ${hass.localize("panel.states")} + + - ${beforeSpacer.map((panel) => renderPanel(hass, panel))} + ${beforeSpacer.map((panel) => renderPanel(hass, panel))} -
+
- ${afterSpacer.map((panel) => renderPanel(hass, panel))} - ${this._externalConfig && this._externalConfig.hasSettingsScreen - ? html` - - - - - ${hass.localize("ui.sidebar.external_app_configuration")} - - - - ` - : ""} - -
- - - - ${notificationCount > 0 + ${afterSpacer.map((panel) => renderPanel(hass, panel))} + ${this._externalConfig && this._externalConfig.hasSettingsScreen ? html` - - ${notificationCount} - + + + + + ${hass.localize("ui.sidebar.external_app_configuration")} + + + ` : ""} - - ${hass.localize("ui.notification_drawer.title")} - - - - - +
+ + + ${notificationCount > 0 + ? html` + + ${notificationCount} + + ` + : ""} - ${hass.user ? hass.user.name : ""} + ${hass.localize("ui.notification_drawer.title")} -
-
+ + + + + + + ${hass.user ? hass.user.name : ""} + + + +
+ + `; } @@ -306,7 +314,7 @@ class HaSidebar extends LitElement { :host { height: 100%; display: block; - overflow: hidden auto; + overflow: hidden; -ms-user-select: none; -webkit-user-select: none; -moz-user-select: none; @@ -325,8 +333,14 @@ class HaSidebar extends LitElement { width: 256px; } + .wrapper { + overflow-y: auto; + height: calc(100% - 65px); + } + .menu { - height: 64px; + box-sizing: border-box; + height: 65px; display: flex; padding: 0 12px; border-bottom: 1px solid transparent; @@ -357,8 +371,7 @@ class HaSidebar extends LitElement { } paper-listbox { - padding: 4px 0; - height: calc(100% - 65px); + padding: 4px 0 0; display: flex; flex-direction: column; box-sizing: border-box; @@ -428,10 +441,9 @@ class HaSidebar extends LitElement { } .divider { - bottom: 88px; + bottom: 112px; padding: 10px 0; } - .divider::before { content: " "; display: block; @@ -442,11 +454,11 @@ class HaSidebar extends LitElement { .notifications { margin-top: 0; margin-bottom: 0; - bottom: 48px; + bottom: 72px; cursor: pointer; } .profile { - bottom: 0; + bottom: 24px; } .profile paper-icon-item { padding-left: 4px; @@ -454,8 +466,13 @@ class HaSidebar extends LitElement { .profile .item-text { margin-left: 8px; } + .bottom-spacer { + bottom: 0; + padding: 12px 0; + } .sticky-el { + position: -webkit-sticky; position: sticky; background-color: var( --sidebar-background-color,