Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed LTR force - looks much better #6404

Merged
merged 1 commit into from
Jul 17, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/panels/developer-tools/event/developer-tools-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) {
-moz-user-select: initial;
@apply --paper-font-body1;
padding: 16px;
direction: ltr;
display: block;
}

Expand Down
27 changes: 25 additions & 2 deletions src/panels/developer-tools/service/developer-tools-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box";
import LocalizeMixin from "../../../mixins/localize-mixin";
import "../../../styles/polymer-ha-style";
import "../../../util/app-localstorage-document";
import { computeRTL } from "../../../common/util/compute_rtl";

const ERROR_SENTINEL = {};
/*
Expand All @@ -26,7 +27,6 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
-moz-user-select: initial;
display: block;
padding: 16px;
direction: ltr;
}

.ha-form {
Expand All @@ -51,8 +51,13 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
text-align: left;
}

:host([rtl]) .attributes th {
text-align: right;
}

.attributes tr {
vertical-align: top;
direction: ltr;
}

.attributes tr:nth-child(odd) {
Expand Down Expand Up @@ -83,6 +88,14 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
.error {
color: var(--error-color);
}

:host([rtl]) .desc-container {
text-align: right;
}

:host([rtl]) .desc-container h3 {
direction: ltr;
bramkragten marked this conversation as resolved.
Show resolved Hide resolved
}
</style>

<app-localstorage-document
Expand Down Expand Up @@ -141,7 +154,9 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
</h1>
</template>
<template is="dom-if" if="[[_description]]">
<h3>[[_description]]</h3>
<div class="desc-container">
<h3>[[_description]]</h3>
</div>

<table class="attributes">
<tr>
Expand Down Expand Up @@ -227,6 +242,10 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
type: String,
computed: "_computeDescription(hass, _domain, _service)",
},
rtl: {
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
};
}

Expand Down Expand Up @@ -329,6 +348,10 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
_yamlChanged(ev) {
this.serviceData = ev.detail.value;
}

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

customElements.define("developer-tools-service", HaPanelDevService);
15 changes: 14 additions & 1 deletion src/panels/developer-tools/state/developer-tools-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { EventsMixin } from "../../../mixins/events-mixin";
import LocalizeMixin from "../../../mixins/localize-mixin";
import "../../../styles/polymer-ha-style";
import { mdiInformationOutline } from "@mdi/js";
import { computeRTL } from "../../../common/util/compute_rtl";

const ERROR_SENTINEL = {};
/*
Expand All @@ -29,7 +30,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
-moz-user-select: initial;
display: block;
padding: 16px;
direction: ltr;
}

.inputs {
Expand All @@ -44,8 +44,13 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
text-align: left;
}

:host([rtl]) .entities th {
text-align: right;
}

.entities tr {
vertical-align: top;
direction: ltr;
}

.entities tr:nth-child(odd) {
Expand Down Expand Up @@ -232,6 +237,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
computed:
"computeEntities(hass, _entityFilter, _stateFilter, _attributeFilter)",
},
rtl: {
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
};
}

Expand Down Expand Up @@ -396,6 +405,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
_yamlChanged(ev) {
this._stateAttributes = ev.detail.value;
}

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

customElements.define("developer-tools-state", HaPanelDevState);