mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
parent
4cd3b683a7
commit
ecd33fd93c
@ -74,8 +74,8 @@ export const dialogManagerMixin = (
|
|||||||
if (!(dialogTag in LOADED)) {
|
if (!(dialogTag in LOADED)) {
|
||||||
LOADED[dialogTag] = dialogImport().then(() => {
|
LOADED[dialogTag] = dialogImport().then(() => {
|
||||||
const dialogEl = document.createElement(dialogTag) as HassDialog;
|
const dialogEl = document.createElement(dialogTag) as HassDialog;
|
||||||
this.shadowRoot!.appendChild(dialogEl);
|
|
||||||
this.provideHass(dialogEl);
|
this.provideHass(dialogEl);
|
||||||
|
this.shadowRoot!.appendChild(dialogEl);
|
||||||
return dialogEl;
|
return dialogEl;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
|
|
||||||
import LocalizeMixin from "../mixins/localize-mixin";
|
import LocalizeMixin from "../mixins/localize-mixin";
|
||||||
|
import { computeRTL } from "../common/util/compute_rtl";
|
||||||
|
|
||||||
class NotificationManager extends LocalizeMixin(PolymerElement) {
|
class NotificationManager extends LocalizeMixin(PolymerElement) {
|
||||||
static get template() {
|
static get template() {
|
||||||
@ -14,6 +15,7 @@ class NotificationManager extends LocalizeMixin(PolymerElement) {
|
|||||||
|
|
||||||
<ha-toast
|
<ha-toast
|
||||||
id="toast"
|
id="toast"
|
||||||
|
dir="[[_rtl]]"
|
||||||
no-cancel-on-outside-click="[[_cancelOnOutsideClick]]"
|
no-cancel-on-outside-click="[[_cancelOnOutsideClick]]"
|
||||||
></ha-toast>
|
></ha-toast>
|
||||||
`;
|
`;
|
||||||
@ -27,6 +29,11 @@ class NotificationManager extends LocalizeMixin(PolymerElement) {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_rtl: {
|
||||||
|
type: String,
|
||||||
|
computed: "_computeRTLDirection(hass)",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,6 +45,10 @@ class NotificationManager extends LocalizeMixin(PolymerElement) {
|
|||||||
showDialog({ message }) {
|
showDialog({ message }) {
|
||||||
this.$.toast.show(message);
|
this.$.toast.show(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeRTLDirection(hass) {
|
||||||
|
return computeRTL(hass) ? "rtl" : "ltr";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("notification-manager", NotificationManager);
|
customElements.define("notification-manager", NotificationManager);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user