Skip to content

Commit

Permalink
Merge pull request #155 from defunkt/remove-initial-popstate-detection
Browse files Browse the repository at this point in the history
Remove initial popstate detection
  • Loading branch information
josh committed Jul 6, 2012
2 parents a192872 + d277b7f commit aed1438
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions jquery.pjax.js
Expand Up @@ -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) {
Expand Down

0 comments on commit aed1438

Please sign in to comment.