mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 14:56:37 +00:00
Use polyfill from toggleAttribute (#9969)
This commit is contained in:
parent
c6e83cb7c0
commit
40664997e1
@ -19,6 +19,7 @@ import { ifDefined } from "lit/directives/if-defined";
|
|||||||
import { formatDateTimeWithSeconds } from "../../common/datetime/format_date_time";
|
import { formatDateTimeWithSeconds } from "../../common/datetime/format_date_time";
|
||||||
import relativeTime from "../../common/datetime/relative_time";
|
import relativeTime from "../../common/datetime/relative_time";
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
|
import { toggleAttribute } from "../../common/dom/toggle_attribute";
|
||||||
import { LogbookEntry } from "../../data/logbook";
|
import { LogbookEntry } from "../../data/logbook";
|
||||||
import {
|
import {
|
||||||
ChooseAction,
|
ChooseAction,
|
||||||
@ -552,7 +553,7 @@ export class HaAutomationTracer extends LitElement {
|
|||||||
this.shadowRoot!.querySelectorAll<HaTimeline>(
|
this.shadowRoot!.querySelectorAll<HaTimeline>(
|
||||||
"ha-timeline[data-path]"
|
"ha-timeline[data-path]"
|
||||||
).forEach((el) => {
|
).forEach((el) => {
|
||||||
el.toggleAttribute("selected", this.selectedPath === el.dataset.path);
|
toggleAttribute(el, "selected", this.selectedPath === el.dataset.path);
|
||||||
if (!this.allowPick || el.tabIndex === 0) {
|
if (!this.allowPick || el.tabIndex === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,11 @@ class HuiGridCard extends HuiStackCard<GridCardConfig> {
|
|||||||
setConfig(config: GridCardConfig) {
|
setConfig(config: GridCardConfig) {
|
||||||
super.setConfig(config);
|
super.setConfig(config);
|
||||||
this.style.setProperty("--grid-card-column-count", String(this.columns));
|
this.style.setProperty("--grid-card-column-count", String(this.columns));
|
||||||
this.toggleAttribute("square", this.square);
|
if (this.square) {
|
||||||
|
this.setAttribute("square", "");
|
||||||
|
} else {
|
||||||
|
this.removeAttribute("square");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
|
@ -33,6 +33,7 @@ import "@material/mwc-icon-button/mwc-icon-button";
|
|||||||
import "../../../components/ha-svg-icon";
|
import "../../../components/ha-svg-icon";
|
||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import "../../../components/ha-button-toggle-group";
|
import "../../../components/ha-button-toggle-group";
|
||||||
|
import { toggleAttribute } from "../../../common/dom/toggle_attribute";
|
||||||
|
|
||||||
const viewButtons: ToggleButton[] = [
|
const viewButtons: ToggleButton[] = [
|
||||||
{ label: "Day", value: "day" },
|
{ label: "Day", value: "day" },
|
||||||
@ -55,7 +56,7 @@ export class HuiEnergyPeriodSelector extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
public connectedCallback() {
|
public connectedCallback() {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
this.toggleAttribute("narrow", this.offsetWidth < 600);
|
toggleAttribute(this, "narrow", this.offsetWidth < 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
public hassSubscribe(): UnsubscribeFunc[] {
|
public hassSubscribe(): UnsubscribeFunc[] {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user