mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Refactor ha-dialog RTL to include dialogs not using createCloseHeader
This commit is contained in:
parent
ba67b1291f
commit
377c37425e
@ -5,7 +5,7 @@ import "./ha-icon-button";
|
||||
import { css, CSSResult, customElement, html } from "lit-element";
|
||||
import type { Constructor, HomeAssistant } from "../types";
|
||||
import { mdiClose } from "@mdi/js";
|
||||
import { computeRTL } from "../common/util/compute_rtl";
|
||||
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||
|
||||
const MwcDialog = customElements.get("mwc-dialog") as Constructor<Dialog>;
|
||||
|
||||
@ -14,8 +14,8 @@ export const createCloseHeading = (hass: HomeAssistant, title: string) => html`
|
||||
<mwc-icon-button
|
||||
aria-label=${hass.localize("ui.dialogs.generic.close")}
|
||||
dialogAction="close"
|
||||
?rtl=${computeRTL(hass)}
|
||||
class="header_button"
|
||||
dir=${computeRTLDirection(hass)}
|
||||
>
|
||||
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
@ -61,7 +61,7 @@ export class HaDialog extends MwcDialog {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
mwc-icon-button[rtl].header_button {
|
||||
[dir="rtl"].header_button {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import "./hui-card-preview";
|
||||
import type { EditCardDialogParams } from "./show-edit-card-dialog";
|
||||
import { getCardDocumentationURL } from "../get-card-documentation-url";
|
||||
import { mdiHelpCircle } from "@mdi/js";
|
||||
import { computeRTLDirection } from "../../../../common/util/compute_rtl";
|
||||
|
||||
declare global {
|
||||
// for fire event
|
||||
@ -133,6 +134,7 @@ export class HuiDialogEditCard extends LitElement {
|
||||
title=${this.hass!.localize("ui.panel.lovelace.menu.help")}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
dir=${computeRTLDirection(this.hass)}
|
||||
>
|
||||
<mwc-icon-button>
|
||||
<ha-svg-icon path=${mdiHelpCircle}></ha-svg-icon>
|
||||
|
Loading…
x
Reference in New Issue
Block a user