Skip to content

Commit

Permalink
Při volání replaceState nenahrazujeme za kompletně vlastní stav, al…
Browse files Browse the repository at this point in the history
…e zachováváme původní objekt, pokud nějaký byl.
  • Loading branch information
zipper committed Dec 9, 2021
1 parent b3b2d35 commit faf07f4
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 faf07f4

Please sign in to comment.