mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-14 21:40:27 +00:00
Add demo (#2502)
* Add demo * Fix stuff * Lint * Typescript and demo card * More fixes * Allow switching through configs * Lint * Lint2 * Add two demo configs * Lint * Lint
This commit is contained in:
@@ -5,10 +5,18 @@ export const navigate = (
|
||||
path: string,
|
||||
replace: boolean = false
|
||||
) => {
|
||||
if (replace) {
|
||||
history.replaceState(null, "", path);
|
||||
if (__DEMO__) {
|
||||
if (replace) {
|
||||
history.replaceState(null, "", `${location.pathname}#${path}`);
|
||||
} else {
|
||||
window.location.hash = path;
|
||||
}
|
||||
} else {
|
||||
history.pushState(null, "", path);
|
||||
if (replace) {
|
||||
history.replaceState(null, "", path);
|
||||
} else {
|
||||
history.pushState(null, "", path);
|
||||
}
|
||||
}
|
||||
fireEvent(node, "location-changed");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user