Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/panels/history/ha-panel-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "../../resources/ha-style";

import formatDate from "../../common/datetime/format_date";
import LocalizeMixin from "../../mixins/localize-mixin";
import { computeRTL } from "../../common/util/compute_rtl";

/*
* @appliesMixin LocalizeMixin
Expand All @@ -37,6 +38,15 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {

paper-dropdown-menu {
max-width: 100px;
margin-top: 13px;
margin-right: 16px;
--paper-input-container-label-floating: {
padding-bottom: 10px;
}
}

:host([rtl]) paper-dropdown-menu {
text-align: right;
}

paper-item {
Expand Down Expand Up @@ -158,6 +168,12 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {
type: String,
value: "date",
},

rtl: {
type: Boolean,
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
};
}

Expand Down Expand Up @@ -198,6 +214,10 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {
return 1;
}
}

_computeRTL(hass) {
return computeRTL(hass);
}
}

customElements.define("ha-panel-history", HaPanelHistory);
18 changes: 18 additions & 0 deletions src/panels/logbook/ha-panel-logbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "./ha-logbook";

import formatDate from "../../common/datetime/format_date";
import LocalizeMixin from "../../mixins/localize-mixin";
import { computeRTL } from "../../common/util/compute_rtl";

/*
* @appliesMixin LocalizeMixin
Expand Down Expand Up @@ -52,6 +53,13 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
paper-dropdown-menu {
max-width: 100px;
margin-right: 16px;
--paper-input-container-label-floating: {
padding-bottom: 10px;
}
}

:host([rtl]) paper-dropdown-menu {
text-align: right;
}

paper-item {
Expand Down Expand Up @@ -205,6 +213,12 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
datePicker: {
type: Object,
},

rtl: {
type: Boolean,
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
};
}

Expand Down Expand Up @@ -242,6 +256,10 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
refreshLogbook() {
this.shadowRoot.querySelector("ha-logbook-data").refreshLogbook();
}

_computeRTL(hass) {
return computeRTL(hass);
}
}

customElements.define("ha-panel-logbook", HaPanelLogbook);
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@
"period": "Period"
},
"logbook": {
"showing_entries": "[%key:ui::panel::history::showing_entries%]"
"showing_entries": "[%key:ui::panel::history::showing_entries%]",
"period": "Period"
},
"lovelace": {
"cards": {
Expand Down