Skip to content

Commit 0308b01

Browse files
committed
Ignore pops back to same state
/cc @cobyism
1 parent b11e196 commit 0308b01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jquery.pjax.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ function onPjaxPopstate(event) {
401401
// page.
402402
if (initialPop && initialURL == state.url) return
403403

404+
// If popping back to the same state, just skip.
405+
// Could be clicking back from hashchange rather than a pushState.
406+
if (pjax.state.id === state.id) return
407+
404408
var container = $(state.container)
405409
if (container.length) {
406410
var direction, contents = cacheMapping[state.id]

0 commit comments

Comments
 (0)