Remove duplicate elements

Duplicates of `ha-paper-icon-button-arrow-prev` & `ha-paper-icon-button-arrow-next`
remove-dupes
Bram Kragten 2020-05-02 13:20:09 +02:00
parent 6a3a1297ad
commit 255740da83
3 changed files with 2 additions and 60 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)]]">