Navigate, refresh and javascript services

This commit is contained in:
2022-07-19 19:42:27 +00:00
parent f12cc164b6
commit a4085ed3ab
7 changed files with 223 additions and 35 deletions

View File

@@ -1,3 +1,5 @@
import { hass_base_el } from "../helpers";
export const BrowserStateMixin = (SuperClass) => {
return class BrowserStateMixinClass extends SuperClass {
constructor() {
@@ -38,10 +40,10 @@ export const BrowserStateMixin = (SuperClass) => {
update();
}
// do_navigate(path) {
// if (!path) return;
// history.pushState(null, "", path);
// fireEvent("location-changed", {}, ha_element());
// }
async browser_navigate(path) {
if (!path) return;
history.pushState(null, "", path);
window.dispatchEvent(new CustomEvent("location-changed"));
}
};
};