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 = { var data = {
components: [], components: [],
image: function () { image: function () {
if(this.logo === '') { if (this.logo === '') {
return ''; return '';
} else { } else {
return '<img data-src="/images/supported_brands/' + this.logo + '">'; 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 * 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;
} }