mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +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
@ -147,7 +147,7 @@ allComponents.pop(); // remove placeholder element at the end
|
||||
var data = {
|
||||
components: [],
|
||||
image: function () {
|
||||
if(this.logo === '') {
|
||||
if (this.logo === '') {
|
||||
return '';
|
||||
} else {
|
||||
return '<img data-src="/images/supported_brands/' + this.logo + '">';
|
||||
@ -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
|
||||
*/
|
||||
function updateHash(newHash) {
|
||||
if ('replaceState' in history) {
|
||||
history.replaceState('', '', newHash);
|
||||
if ('pushState' in history) {
|
||||
history.pushState('', '', newHash);
|
||||
} else {
|
||||
location.hash = newHash;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user