From d277b7fdcf75b682316fd0552d0e9cfc740589f5 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 27 Jun 2012 14:50:25 -0500 Subject: [PATCH] Remove initial popstate detection --- jquery.pjax.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/jquery.pjax.js b/jquery.pjax.js index 1dfaf496..1d96db00 100644 --- a/jquery.pjax.js +++ b/jquery.pjax.js @@ -558,21 +558,11 @@ var containerCache = new Cache pjax.click = handleClick -// Used to detect initial (useless) popstate. -// If history.state exists, assume browser isn't going to fire initial popstate. -var popped = ('state' in window.history), initialURL = location.href - - // popstate handler takes care of the back and forward buttons // // You probably shouldn't use pjax on pages with other pushState // stuff yet. $(window).bind('popstate', function(event){ - // Ignore inital popstate that some browsers fire on page load - var initialPop = !popped && location.href == initialURL - popped = true - if ( initialPop ) return - var state = event.state if (state && state.container) {