Skip to content

Commit

Permalink
Ignore pops back to same state
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jul 25, 2013
1 parent b11e196 commit 0308b01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jquery.pjax.js
Expand Up @@ -401,6 +401,10 @@ function onPjaxPopstate(event) {
// page.
if (initialPop && initialURL == state.url) return

// If popping back to the same state, just skip.
// Could be clicking back from hashchange rather than a pushState.
if (pjax.state.id === state.id) return

var container = $(state.container)
if (container.length) {
var direction, contents = cacheMapping[state.id]
Expand Down

1 comment on commit 0308b01

@cobyism
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💖

Please sign in to comment.