RTL support for arrows in scrolable tabs (#2696)

* RTL support for arrows in scrolable tabs

* Refactor
This commit is contained in:
yosilevy 2019-02-08 05:32:32 +02:00 committed by Paulus Schoutsen
parent 17d0ae003a
commit 102cb06d28

View File

@ -49,7 +49,7 @@ import { showEditLovelaceDialog } from "./editor/lovelace-editor/show-edit-lovel
import { Lovelace } from "./types"; import { Lovelace } from "./types";
import { afterNextRender } from "../../common/util/render-status"; import { afterNextRender } from "../../common/util/render-status";
import { haStyle } from "../../resources/ha-style"; import { haStyle } from "../../resources/ha-style";
import { computeRTL } from "../../common/util/compute_rtl"; import { computeRTL, computeRTLDirection } from "../../common/util/compute_rtl";
// CSS and JS should only be imported once. Modules and HTML are safe. // CSS and JS should only be imported once. Modules and HTML are safe.
const CSS_CACHE = {}; const CSS_CACHE = {};
@ -244,6 +244,7 @@ class HUIRoot extends LitElement {
scrollable scrollable
.selected="${this._curView}" .selected="${this._curView}"
@iron-activate="${this._handleViewSelected}" @iron-activate="${this._handleViewSelected}"
dir="${computeRTLDirection(this.hass!)}"
> >
${this.lovelace!.config.views.map( ${this.lovelace!.config.views.map(
(view) => html` (view) => html`