Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Import editor in showEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar authored Jun 28, 2019
1 parent 33ea361 commit adc24ec
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compact-custom-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ if (
if (firstRun) buildConfig();
run();

if (lovelace.mode == "storage" && firstRun) {
import("./compact-custom-header-editor.js").then(() => {
document.createElement("compact-custom-header-editor");
});
}

function run() {
const disable = cchConfig.disable;
const urlDisable = window.location.href.includes("disable_cch");
Expand Down Expand Up @@ -923,6 +917,9 @@ function buildRanges(array) {

function showEditor() {
if (!root.querySelector("ha-app-layout").querySelector("editor")) {
import("./compact-custom-header-editor.js").then(() => {
document.createElement("compact-custom-header-editor");
});
const container = document.createElement("editor");
const nest = document.createElement("div");
const cchEditor = document.createElement("compact-custom-header-editor");
Expand Down

0 comments on commit adc24ec

Please sign in to comment.