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:
Piotr Żuralski 2019-05-11 18:44:51 +02:00 committed by Fabian Affolter
parent 9e654ff3c6
commit e9ea976cb1

View File

@ -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;
}