From faf07f45f43096219452bfe7f3a1442f93861b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0er=C3=BD?= Date: Thu, 9 Dec 2021 13:13:56 +0100 Subject: [PATCH] =?UTF-8?q?P=C5=99i=20vol=C3=A1n=C3=AD=20`replaceState`=20?= =?UTF-8?q?nenahrazujeme=20za=20kompletn=C4=9B=20vlastn=C3=AD=20stav,=20al?= =?UTF-8?q?e=20zachov=C3=A1v=C3=A1me=20p=C5=AFvodn=C3=AD=20objekt,=20pokud?= =?UTF-8?q?=20n=C4=9Bjak=C3=BD=20byl.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-side/history.ajax.js | 16 ++++++++++------ package.json | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client-side/history.ajax.js b/client-side/history.ajax.js index 12a8e7e..96d19c2 100644 --- a/client-side/history.ajax.js +++ b/client-side/history.ajax.js @@ -62,12 +62,16 @@ } }, this)); - history.replaceState(this.initialState = { - nette: true, - href: window.location.href, - title: document.title, - ui: this.cache ? findSnippets() : null - }, document.title, window.location.href); + this.initialState = $.extend({}, + history.state || {}, + { + nette: true, + href: window.location.href, + title: document.title, + ui: this.cache ? findSnippets() : null + }); + + history.replaceState(this.initialState, document.title, window.location.href); }, before: function (xhr, settings) { if (!settings.nette) { diff --git a/package.json b/package.json index eb6b68e..af89412 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "history.nette.ajax.js", "title": "history.nette.ajax.js", "description": "Adds History API support for Nette Framework.", - "version": "1.0.1", + "version": "1.0.2", "author": "Vojtech Dobes ", "contributors": [ "Radek Šerý "