diff --git a/pyproject.toml b/pyproject.toml index 9a413e0d22..38b0d8ad8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20220901.0" +version = "20220902.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md" diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index d8658966e5..10859151c8 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -15,6 +15,8 @@ class HassSubpage extends LitElement { @property({ type: String, attribute: "back-path" }) public backPath?: string; + @property() public backCallback?: () => void; + @property({ type: Boolean, reflect: true }) public narrow = false; @property({ type: Boolean }) public supervisor = false; @@ -52,6 +54,9 @@ class HassSubpage extends LitElement {
+
+ +
`; } @@ -61,6 +66,10 @@ class HassSubpage extends LitElement { } private _backTapped(): void { + if (this.backCallback) { + this.backCallback(); + return; + } history.back(); } @@ -116,6 +125,29 @@ class HassSubpage extends LitElement { overflow: auto; -webkit-overflow-scrolling: touch; } + + #fab { + position: fixed; + right: calc(16px + env(safe-area-inset-right)); + bottom: calc(16px + env(safe-area-inset-bottom)); + z-index: 1; + } + :host([narrow]) #fab.tabs { + bottom: calc(84px + env(safe-area-inset-bottom)); + } + #fab[is-wide] { + bottom: 24px; + right: 24px; + } + :host([rtl]) #fab { + right: auto; + left: calc(16px + env(safe-area-inset-left)); + } + :host([rtl][is-wide]) #fab { + bottom: 24px; + left: 24px; + right: auto; + } `; } } diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 70c0d5a7f0..77cd37c48c 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -51,7 +51,7 @@ import { showPromptDialog, } from "../../../dialogs/generic/show-dialog-box"; import "../../../layouts/ha-app-layout"; -import "../../../layouts/hass-tabs-subpage"; +import "../../../layouts/hass-subpage"; import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; @@ -113,7 +113,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { ? this.hass.states[this._entityId] : undefined; return html` - - + `; }