Skip to content

Commit

Permalink
Merge pull request #4 from zipper/0-zachovani-puvodniho-objektu-state
Browse files Browse the repository at this point in the history
Zachování původního state objektu
  • Loading branch information
zipper authored Jan 3, 2022
2 parents b3b2d35 + faf07f4 commit 1322585
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions client-side/history.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"contributors": [
"Radek Šerý <[email protected]>"
Expand Down

0 comments on commit 1322585

Please sign in to comment.