fixed #867 - added proper detection so that onpopstate would not react if it was a proper page load

v1.18.x
Julian Lam 11 years ago
parent 43808c01ec
commit 459d5ddccd

@ -23,7 +23,7 @@ var ajaxify = {};
window.onpopstate = function (event) {
if (event !== null && event.state && event.state.url !== undefined) {
if (event !== null && event.state && event.state.url !== undefined && !ajaxify.initialLoad) {
ajaxify.go(event.state.url, null, true);
}
};
@ -31,6 +31,7 @@ var ajaxify = {};
var pagination, paginator_bar;
ajaxify.currentPage = null;
ajaxify.initialLoad = false;
ajaxify.go = function (url, callback, quiet) {
// "quiet": If set to true, will not call pushState

@ -401,6 +401,7 @@ if(nconf.get('ssl')) {
app.create_route = function (url, tpl) { // to remove
var routerScript = '<script> \
ajaxify.initialLoad = true; \
templates.ready(function(){ajaxify.go("' + url + '", null, true);}); \
</script>';

Loading…
Cancel
Save