Skip to content

Commit 1322585

Browse files
authored
Merge pull request #4 from zipper/0-zachovani-puvodniho-objektu-state
Zachování původního state objektu
2 parents b3b2d35 + faf07f4 commit 1322585

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

client-side/history.ajax.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@
6262
}
6363
}, this));
6464

65-
history.replaceState(this.initialState = {
66-
nette: true,
67-
href: window.location.href,
68-
title: document.title,
69-
ui: this.cache ? findSnippets() : null
70-
}, document.title, window.location.href);
65+
this.initialState = $.extend({},
66+
history.state || {},
67+
{
68+
nette: true,
69+
href: window.location.href,
70+
title: document.title,
71+
ui: this.cache ? findSnippets() : null
72+
});
73+
74+
history.replaceState(this.initialState, document.title, window.location.href);
7175
},
7276
before: function (xhr, settings) {
7377
if (!settings.nette) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "history.nette.ajax.js",
33
"title": "history.nette.ajax.js",
44
"description": "Adds History API support for Nette Framework.",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"author": "Vojtech Dobes <[email protected]>",
77
"contributors": [
88
"Radek Šerý <[email protected]>"

0 commit comments

Comments
 (0)