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

Photoswipe query string causes problems with UI Router #5

Open
rhclayto opened this issue Jan 10, 2016 · 2 comments
Open

Photoswipe query string causes problems with UI Router #5

rhclayto opened this issue Jan 10, 2016 · 2 comments

Comments

@rhclayto
Copy link

When I display an image with the Photoswipe UI, it appends a &gid=x&pid=x query string to the URL. This causes UI Router to see it as a different URL than the base URL of the page as defined in that URL's .state, causing it to immediately redirect to the URL defined in $urlRouterProvider.otherwise().

I can turn this off with Photoswipe's history option, but is there any way to keep the gid&pid history while using this with UI Router?

@m00s
Copy link
Owner

m00s commented Jan 10, 2016

Hi @rhclayto, I use the history option to avoid this behavior because I don't need history right now, but we definitely need a different solution.
I'll spend some time on this later to see what can be done, in the mean time we can keep this open to discuss about it

@rhclayto
Copy link
Author

This issue on Ui-Router's Github page seems to be talking about this problem with UI Router in general & may be of interest:

angular-ui/ui-router#64

There are a few attempted solutions there. I tried the simple one of using reloadOnSearch: false in the $state configuration, & it allowed Photoswipe to change the URL without UI Router trying to change the state; however, using that URL as a bookmark for example isn't useful because using the URL with the parameters doesn't actually activate Photoswipe, you just get the base view that Photoswipe is part of.

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

No branches or pull requests

2 participants