igor-alexandrov / wiselinks

If Turbolinks are not enough for you. Wiselinks makes your application work faster.
MIT License
726 stars 93 forks source link

intercept or halt wizelinks to call ajax when pressing browser back button #108

Open staroflead opened 8 years ago

staroflead commented 8 years ago

I built an index page with posts, when user click on the post, it's content is displayed on a popup and thanks to wizelinks, it works nice ( with page titlte, address url). However, when I press Chrome 's back button, it invokes ajax call again and renders index page within the popup!

Can you show me how to intercept/ halt wizelinks to call ajax at this point? I just want to close the popup and change back url without invoking wizelinks and load the content.

staroflead commented 8 years ago

There is another problem regarding browser back button too, if these 2 be fix, wizelink will be undoubted best history tool around. First i read a post via ajax request, then F5 to refresh page. browser sends get request to get post content again ( showing full template and layout), then I press back button, it call last page via Ajax, which will render nothing because lack of container div in my posts/show page. Is there a way to do history.back(-1) normally for this case?