mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
pushing fix to ajaxify where the homepage did not get added to the history (and thus was unreachable via history action
This commit is contained in:
@@ -21,8 +21,8 @@ var ajaxify = {};
|
||||
|
||||
|
||||
window.onpopstate = function(event) {
|
||||
console.log('popstate called:', event);
|
||||
if (event !== null && event.state && event.state.url) ajaxify.go(event.state.url, null, null, true);
|
||||
console.log('popstate called:', event.state);
|
||||
if (event !== null && event.state && event.state.url !== undefined) ajaxify.go(event.state.url, null, null, true);
|
||||
};
|
||||
|
||||
ajaxify.go = function(url, callback, template, quiet) {
|
||||
@@ -43,6 +43,9 @@ var ajaxify = {};
|
||||
|
||||
if (templates[tpl_url]) {
|
||||
if (quiet !== true) {
|
||||
console.log('state pushed', {
|
||||
"url": url
|
||||
});
|
||||
window.history.pushState({
|
||||
"url": url
|
||||
}, url, "/" + url);
|
||||
|
||||
Reference in New Issue
Block a user