Open michaelmco opened 10 years ago
How are you running the example?
Both in Chrome on my mac and on my iPhone.
I just uploaded it to my server. michaelm.co/new That fixed my issue in chrome on my mac (I had been testing locally before), but the issue persists on my iPhone. Thanks for your help.
Hmm, I don't have time to dig in right now, but I am sure if you dig in to app.js
, you'll find the culprit by searching for popState
/ pushState
.
@michaelmco
@briangonzalez
It's working.. Browsers' both back and forward buttons are working well... Just comment the if
block in the following function:
ArticleAnimator.bindPopstate = function(){
var self = this;
$window.on('popstate', function(e){
/*if( !history.state || self.initialLoad ){
self.initialLoad = false;
return;
}*/
self.currentPostIndex = history.state.index;
self.$current.replaceWith( history.state.current );
self.$next.replaceWith( history.state.next );
self.refreshCurrentAndNextSelection();
self.createPost({ type: 'next' });
self.bindGotoNextClick();
});
}
Hi thanks so much for posting the article! I have a really quick question.
When I hit the back button in the browser, it will change the url from index.html#2 to index.html#1 but the data from "post_2.json" remains.
Thanks in advance.