mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Make the "icon next/prev" series load faster (#18087)
This commit is contained in:
parent
c25447d001
commit
242b018ece
@ -12,19 +12,8 @@ export class HaIconButtonArrowNext extends LitElement {
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@state() private _icon = mdiArrowRight;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this._icon =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiArrowRight
|
||||
: mdiArrowLeft;
|
||||
}, 100);
|
||||
}
|
||||
@state() private _icon =
|
||||
document.dir === "ltr" ? mdiArrowRight : mdiArrowLeft;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
|
@ -12,19 +12,8 @@ export class HaIconButtonArrowPrev extends LitElement {
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@state() private _icon = mdiArrowLeft;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this._icon =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiArrowLeft
|
||||
: mdiArrowRight;
|
||||
}, 100);
|
||||
}
|
||||
@state() private _icon =
|
||||
document.dir === "ltr" ? mdiArrowLeft : mdiArrowRight;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
|
@ -12,19 +12,8 @@ export class HaIconButtonNext extends LitElement {
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@state() private _icon = mdiChevronRight;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this._icon =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiChevronRight
|
||||
: mdiChevronLeft;
|
||||
}, 100);
|
||||
}
|
||||
@state() private _icon =
|
||||
document.dir === "ltr" ? mdiChevronRight : mdiChevronLeft;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
|
@ -12,19 +12,8 @@ export class HaIconButtonPrev extends LitElement {
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@state() private _icon = mdiChevronLeft;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this._icon =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiChevronLeft
|
||||
: mdiChevronRight;
|
||||
}, 100);
|
||||
}
|
||||
@state() private _icon =
|
||||
document.dir === "ltr" ? mdiChevronLeft : mdiChevronRight;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
|
@ -4,17 +4,7 @@ import { HaSvgIcon } from "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-next")
|
||||
export class HaIconNext extends HaSvgIcon {
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this.path =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiChevronRight
|
||||
: mdiChevronLeft;
|
||||
}, 100);
|
||||
}
|
||||
path = document.dir === "ltr" ? mdiChevronRight : mdiChevronLeft;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
@ -4,17 +4,7 @@ import { HaSvgIcon } from "./ha-svg-icon";
|
||||
|
||||
@customElement("ha-icon-prev")
|
||||
export class HaIconPrev extends HaSvgIcon {
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
||||
// wait to check for direction since otherwise direction is wrong even though top level is RTL
|
||||
setTimeout(() => {
|
||||
this.path =
|
||||
window.getComputedStyle(this).direction === "ltr"
|
||||
? mdiChevronLeft
|
||||
: mdiChevronRight;
|
||||
}, 100);
|
||||
}
|
||||
path = document.dir === "ltr" ? mdiChevronLeft : mdiChevronRight;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
Loading…
x
Reference in New Issue
Block a user