Remove duplicate elements
Duplicates of `ha-paper-icon-button-arrow-prev` & `ha-paper-icon-button-arrow-next`remove-dupes
parent
6a3a1297ad
commit
255740da83
|
@ -1,29 +0,0 @@
|
|||
import "@polymer/paper-icon-button/paper-icon-button";
|
||||
import type { PaperIconButtonElement } from "@polymer/paper-icon-button/paper-icon-button";
|
||||
import type { Constructor } from "../types";
|
||||
|
||||
const paperIconButtonClass = customElements.get(
|
||||
"paper-icon-button"
|
||||
) as Constructor<PaperIconButtonElement>;
|
||||
|
||||
export class HaPaperIconButtonNext extends paperIconButtonClass {
|
||||
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"
|
||||
? "hass:chevron-right"
|
||||
: "hass:chevron-left";
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-paper-icon-button-next": HaPaperIconButtonNext;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("ha-paper-icon-button-next", HaPaperIconButtonNext);
|
|
@ -1,29 +0,0 @@
|
|||
import "@polymer/paper-icon-button/paper-icon-button";
|
||||
import type { PaperIconButtonElement } from "@polymer/paper-icon-button/paper-icon-button";
|
||||
import type { Constructor } from "../types";
|
||||
|
||||
const paperIconButtonClass = customElements.get(
|
||||
"paper-icon-button"
|
||||
) as Constructor<PaperIconButtonElement>;
|
||||
|
||||
export class HaPaperIconButtonPrev extends paperIconButtonClass {
|
||||
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"
|
||||
? "hass:chevron-left"
|
||||
: "hass:chevron-right";
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-paper-icon-button-prev": HaPaperIconButtonPrev;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("ha-paper-icon-button-prev", HaPaperIconButtonPrev);
|
|
@ -6,7 +6,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||
/* eslint-plugin-disable lit */
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
import { computeDomain } from "../../common/entity/compute_domain";
|
||||
import "../../components/ha-paper-icon-button-prev";
|
||||
import "../../components/ha-paper-icon-button-arrow-prev";
|
||||
import { subscribeNotifications } from "../../data/persistent_notification";
|
||||
import { EventsMixin } from "../../mixins/events-mixin";
|
||||
import LocalizeMixin from "../../mixins/localize-mixin";
|
||||
|
@ -51,7 +51,7 @@ export class HuiNotificationDrawer extends EventsMixin(
|
|||
<app-drawer id="drawer" opened="{{open}}" disable-swipe align="start">
|
||||
<app-toolbar>
|
||||
<div main-title>[[localize('ui.notification_drawer.title')]]</div>
|
||||
<ha-paper-icon-button-prev on-click="_closeDrawer" aria-label$="[[localize('ui.notification_drawer.close')]]"></paper-icon-button>
|
||||
<ha-paper-icon-button-arrow-prev on-click="_closeDrawer" aria-label$="[[localize('ui.notification_drawer.close')]]"></ha-paper-icon-button-arrow-prev>
|
||||
</app-toolbar>
|
||||
<div class="notifications">
|
||||
<template is="dom-if" if="[[!_empty(notifications)]]">
|
||||
|
|
Loading…
Reference in New Issue