From 255740da8339de48e69078623f27dc184038cbc2 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 2 May 2020 13:20:09 +0200 Subject: [PATCH] Remove duplicate elements Duplicates of `ha-paper-icon-button-arrow-prev` & `ha-paper-icon-button-arrow-next` --- src/components/ha-paper-icon-button-next.ts | 29 ------------------- src/components/ha-paper-icon-button-prev.ts | 29 ------------------- .../notifications/notification-drawer.js | 4 +-- 3 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 src/components/ha-paper-icon-button-next.ts delete mode 100644 src/components/ha-paper-icon-button-prev.ts diff --git a/src/components/ha-paper-icon-button-next.ts b/src/components/ha-paper-icon-button-next.ts deleted file mode 100644 index e119c7f4ce..0000000000 --- a/src/components/ha-paper-icon-button-next.ts +++ /dev/null @@ -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; - -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); diff --git a/src/components/ha-paper-icon-button-prev.ts b/src/components/ha-paper-icon-button-prev.ts deleted file mode 100644 index b2567f6c5f..0000000000 --- a/src/components/ha-paper-icon-button-prev.ts +++ /dev/null @@ -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; - -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); diff --git a/src/dialogs/notifications/notification-drawer.js b/src/dialogs/notifications/notification-drawer.js index 2dc35ec70c..5cb78acc7d 100644 --- a/src/dialogs/notifications/notification-drawer.js +++ b/src/dialogs/notifications/notification-drawer.js @@ -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(
[[localize('ui.notification_drawer.title')]]
- +