Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second click refreshes the page #14

Closed
gillesfabio opened this issue Aug 30, 2014 · 6 comments
Closed

Second click refreshes the page #14

gillesfabio opened this issue Aug 30, 2014 · 6 comments

Comments

@gillesfabio
Copy link
Contributor

Hi MoOx! If I click on a link twice... The page is refreshed.

Reproductible on your own site :)

Any idea?

@MoOx
Copy link
Owner

MoOx commented Aug 30, 2014

It's not a bug, it's a feature. As a user I expect an action if I click on a link I'm already on. I didnt want to do nothing or just reload the content cause of my website effect (slide on smae content doesnt make sense).

Any idea on how to handle that special click ? Simple content refresh ? Current behavior ? Specific callback ?

@gillesfabio
Copy link
Contributor Author

Thanks for your answer. In some cases, this behavior can entirely break the user experience. Let's take an example. I have a video/audio player that must continuously play a movie/audio while the user is browsing the site. If the user clicks multiple times on a link, the page is reloaded and so kills the player. That would be cool to let developers handling this special click. I (personally) would just go for a simple content refresh (because that's the behavior we expect of PJAX — no full page reload).

CC @pascalgermain

@pascalgermain
Copy link

Hi MoOx. I'm currently developing a website for a web tv. One of the main needs is to display a player, and never "break" it during the user navigation, that's why I looked for a pjax library, and yours is the best I found :)

I understand the second click on a same link is handled as a special case, so maybe the best way to do this would be to create an option, allowing to decide which one of the behaviors is triggered? That would be a choice between the three you propose: simple content refresh, current behavior, or custom via a callback, default being current one. Or maybe all three can be handled via a callback? I'm not sure.

@MoOx
Copy link
Owner

MoOx commented Aug 31, 2014

Maybe we can just drop this behavior for now. This should not be the default behavior by default indeed. Maybe an opion but later :)

I'm on vacation for 15days so you should patch this for now.

Pr are welcome but I wont be able to publish a release until 15 sept.

@gillesfabio
Copy link
Contributor Author

I disabled the current behavior and added a new option clickReload (not documented, only code) in PR #15. Bonnes vacances :)

MoOx added a commit that referenced this issue Sep 16, 2014
Fix issue #14 (click on current url don't make a full reload anymore).
@MoOx
Copy link
Owner

MoOx commented Sep 16, 2014

Closing in favor of #17 (and #15 fix that for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants