Fixed label + RTL + X position (#6348)

This commit is contained in:
Yosi Levy 2020-07-10 18:09:07 +03:00 committed by GitHub
parent c9ec4b4e24
commit 875148366e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -125,8 +125,9 @@ class CloudForgotPassword extends LocalizeMixin(EventsMixin(PolymerElement)) {
() => { () => {
this._requestInProgress = false; this._requestInProgress = false;
this.fire("cloud-done", { this.fire("cloud-done", {
flashMessage: flashMessage: this.hass.localize(
"[[localize('ui.panel.config.cloud.forgot_password.check_your_email')]]", "ui.panel.config.cloud.forgot_password.check_your_email"
),
}); });
}, },
(err) => (err) =>

View File

@ -16,6 +16,7 @@ import LocalizeMixin from "../../../../mixins/localize-mixin";
import NavigateMixin from "../../../../mixins/navigate-mixin"; import NavigateMixin from "../../../../mixins/navigate-mixin";
import "../../../../styles/polymer-ha-style"; import "../../../../styles/polymer-ha-style";
import "../../ha-config-section"; import "../../ha-config-section";
import { computeRTL } from "../../../../common/util/compute_rtl";
/* /*
* @appliesMixin NavigateMixin * @appliesMixin NavigateMixin
@ -66,10 +67,14 @@ class CloudLogin extends LocalizeMixin(
} }
.flash-msg ha-icon-button { .flash-msg ha-icon-button {
position: absolute; position: absolute;
top: 8px; top: 4px;
right: 8px; right: 8px;
color: var(--secondary-text-color); color: var(--secondary-text-color);
} }
:host([rtl]) .flash-msg ha-icon-button {
right: auto;
left: 8px;
}
</style> </style>
<hass-subpage header="[[localize('ui.panel.config.cloud.caption')]]"> <hass-subpage header="[[localize('ui.panel.config.cloud.caption')]]">
<div class="content"> <div class="content">
@ -191,6 +196,11 @@ class CloudLogin extends LocalizeMixin(
type: String, type: String,
notify: true, notify: true,
}, },
rtl: {
type: Boolean,
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
_error: String, _error: String,
}; };
} }
@ -306,6 +316,10 @@ class CloudLogin extends LocalizeMixin(
this.flashMessage = ""; this.flashMessage = "";
}, 200); }, 200);
} }
_computeRTL(hass) {
return computeRTL(hass);
}
} }
customElements.define("cloud-login", CloudLogin); customElements.define("cloud-login", CloudLogin);