mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 06:16:50 +00:00
fix for overriding user browser history - replaceState to pushState - user can go back and forward (#9433)
Signed-off-by: Piotr Żuralski <piotr.zuralski@gmail.com>
This commit is contained in:
parent
9e654ff3c6
commit
e9ea976cb1
@ -216,8 +216,8 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
* update the browser location hash. This enables users to use the browser-history
|
* update the browser location hash. This enables users to use the browser-history
|
||||||
*/
|
*/
|
||||||
function updateHash(newHash) {
|
function updateHash(newHash) {
|
||||||
if ('replaceState' in history) {
|
if ('pushState' in history) {
|
||||||
history.replaceState('', '', newHash);
|
history.pushState('', '', newHash);
|
||||||
} else {
|
} else {
|
||||||
location.hash = newHash;
|
location.hash = newHash;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user