mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-27 21:56:35 +00:00
Make preload accessible
This commit is contained in:
parent
ba15c4360a
commit
a5b8f093a6
@ -7,6 +7,10 @@ class InstallButton extends HTMLElement {
|
|||||||
|
|
||||||
private renderRoot?: ShadowRoot;
|
private renderRoot?: ShadowRoot;
|
||||||
|
|
||||||
|
public static preload() {
|
||||||
|
import("./start-flash");
|
||||||
|
}
|
||||||
|
|
||||||
public connectedCallback() {
|
public connectedCallback() {
|
||||||
if (this.renderRoot) {
|
if (this.renderRoot) {
|
||||||
return;
|
return;
|
||||||
@ -22,10 +26,7 @@ class InstallButton extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.setAttribute("install-supported", "");
|
this.setAttribute("install-supported", "");
|
||||||
this.addEventListener("mouseover", () => {
|
this.addEventListener("mouseover", InstallButton.preload);
|
||||||
// Preload
|
|
||||||
import("./start-flash");
|
|
||||||
});
|
|
||||||
this.addEventListener("click", async (ev) => {
|
this.addEventListener("click", async (ev) => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
const manifest = this.manifest || this.getAttribute("manifest");
|
const manifest = this.manifest || this.getAttribute("manifest");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user