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

This commit is contained in:
Julian Lam
2014-01-24 10:09:28 -05:00
parent 43808c01ec
commit 459d5ddccd
2 changed files with 3 additions and 1 deletions

View File

@@ -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