From 654714b85f2af350ee57c937a3cda0b46bfba598 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 30 Oct 2018 21:54:34 -0500 Subject: [PATCH] Move click and tooltip function to LL folder --- .../lovelace/common}/compute-tooltip.ts | 6 +++--- .../dom => panels/lovelace/common}/handle-click.ts | 10 +++++----- src/panels/lovelace/elements/hui-icon-element.ts | 4 ++-- src/panels/lovelace/elements/hui-image-element.ts | 4 ++-- src/panels/lovelace/elements/hui-state-icon-element.ts | 4 ++-- .../lovelace/elements/hui-state-label-element.ts | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/{common/string => panels/lovelace/common}/compute-tooltip.ts (75%) rename src/{common/dom => panels/lovelace/common}/handle-click.ts (72%) diff --git a/src/common/string/compute-tooltip.ts b/src/panels/lovelace/common/compute-tooltip.ts similarity index 75% rename from src/common/string/compute-tooltip.ts rename to src/panels/lovelace/common/compute-tooltip.ts index 4346e972347e..d4441a9278d3 100644 --- a/src/common/string/compute-tooltip.ts +++ b/src/panels/lovelace/common/compute-tooltip.ts @@ -1,6 +1,6 @@ -import computeStateName from "../../common/entity/compute_state_name"; -import { HomeAssistant } from "../../types"; -import { LovelaceElementConfig } from "../../panels/lovelace/elements/types"; +import computeStateName from "../../../common/entity/compute_state_name"; +import { HomeAssistant } from "../../../types"; +import { LovelaceElementConfig } from "../elements/types"; export const computeTooltip = ( hass: HomeAssistant, diff --git a/src/common/dom/handle-click.ts b/src/panels/lovelace/common/handle-click.ts similarity index 72% rename from src/common/dom/handle-click.ts rename to src/panels/lovelace/common/handle-click.ts index 99bd77652408..4d98cf7ad74c 100644 --- a/src/common/dom/handle-click.ts +++ b/src/panels/lovelace/common/handle-click.ts @@ -1,8 +1,8 @@ -import { HomeAssistant } from "../../types"; -import { LovelaceElementConfig } from "../../panels/lovelace/elements/types"; -import { fireEvent } from "../dom/fire_event.js"; -import { navigate } from "../../common/navigate"; -import toggleEntity from "../../../src/panels/lovelace/common/entity/toggle-entity"; +import { HomeAssistant } from "../../../types"; +import { LovelaceElementConfig } from "../elements/types"; +import { fireEvent } from "../../../common/dom/fire_event.js"; +import { navigate } from "../../../common/navigate"; +import toggleEntity from "../../../../src/panels/lovelace/common/entity/toggle-entity"; export const handleClick = ( node: HTMLElement, diff --git a/src/panels/lovelace/elements/hui-icon-element.ts b/src/panels/lovelace/elements/hui-icon-element.ts index 00c291a0c2c2..58c408b8dd9f 100644 --- a/src/panels/lovelace/elements/hui-icon-element.ts +++ b/src/panels/lovelace/elements/hui-icon-element.ts @@ -2,8 +2,8 @@ import { html, LitElement } from "@polymer/lit-element"; import "../../../components/ha-icon.js"; -import { computeTooltip } from "../../../common/string/compute-tooltip"; -import { handleClick } from "../../../common/dom/handle-click"; +import { computeTooltip } from "../common/compute-tooltip"; +import { handleClick } from "../common/handle-click"; import { longPress } from "../common/directives/long-press-directive"; import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { LovelaceElement, LovelaceElementConfig } from "./types.js"; diff --git a/src/panels/lovelace/elements/hui-image-element.ts b/src/panels/lovelace/elements/hui-image-element.ts index 1b79f5a14c2f..97631063b32e 100644 --- a/src/panels/lovelace/elements/hui-image-element.ts +++ b/src/panels/lovelace/elements/hui-image-element.ts @@ -2,8 +2,8 @@ import { html, LitElement } from "@polymer/lit-element"; import "../components/hui-image.js"; -import { computeTooltip } from "../../../common/string/compute-tooltip"; -import { handleClick } from "../../../common/dom/handle-click"; +import { computeTooltip } from "../common/compute-tooltip"; +import { handleClick } from "../common/handle-click"; import { longPress } from "../common/directives/long-press-directive"; import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { LovelaceElement, LovelaceElementConfig } from "./types.js"; diff --git a/src/panels/lovelace/elements/hui-state-icon-element.ts b/src/panels/lovelace/elements/hui-state-icon-element.ts index d75098586aab..574d2f620b3a 100644 --- a/src/panels/lovelace/elements/hui-state-icon-element.ts +++ b/src/panels/lovelace/elements/hui-state-icon-element.ts @@ -3,8 +3,8 @@ import { TemplateResult } from "lit-html"; import "../../../components/entity/state-badge.js"; -import { computeTooltip } from "../../../common/string/compute-tooltip"; -import { handleClick } from "../../../common/dom/handle-click"; +import { computeTooltip } from "../common/compute-tooltip"; +import { handleClick } from "../common/handle-click"; import { longPress } from "../common/directives/long-press-directive"; import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { LovelaceElement, LovelaceElementConfig } from "./types.js"; diff --git a/src/panels/lovelace/elements/hui-state-label-element.ts b/src/panels/lovelace/elements/hui-state-label-element.ts index 50bf3d4e8926..b066d81daea0 100644 --- a/src/panels/lovelace/elements/hui-state-label-element.ts +++ b/src/panels/lovelace/elements/hui-state-label-element.ts @@ -2,9 +2,9 @@ import { html, LitElement } from "@polymer/lit-element"; import "../../../components/entity/ha-state-label-badge.js"; -import { computeTooltip } from "../../../common/string/compute-tooltip"; import computeStateDisplay from "../../../common/entity/compute_state_display.js"; -import { handleClick } from "../../../common/dom/handle-click"; +import { computeTooltip } from "../common/compute-tooltip"; +import { handleClick } from "../common/handle-click"; import { longPress } from "../common/directives/long-press-directive"; import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { LovelaceElement, LovelaceElementConfig } from "./types.js";