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

X and Y coordinates break in sequence mode? #2

Open
kelynch opened this issue Oct 18, 2018 · 7 comments
Open

X and Y coordinates break in sequence mode? #2

kelynch opened this issue Oct 18, 2018 · 7 comments
Labels
bug Something isn't working

Comments

@kelynch
Copy link

kelynch commented Oct 18, 2018

Hello,

I'm using this plugin in a Rails application and noticed that the zoom functionality is preserved but not the x and y coordinates in the URL when you navigate to a page where the OSD viewer is in sequence mode. In collection mode, everything functions as expected. I suspect there might be an issue with the way in which I'm implementing the viewer:

Here's the code:
https://github.com/upenn-libraries/bulwark/blob/feature/COLENDA-124-OSD_enhancements/app/assets/javascripts/colenda.js

https://github.com/upenn-libraries/bulwark/blob/feature/COLENDA-124-OSD_enhancements/app/views/catalog/_show_main_content.html.erb#L17-L19

Any guidance would be greatly appreciated!

@iangilman
Copy link
Member

Interesting. I haven't tried it with sequence mode, so it probably just doesn't support it yet. For one thing, you'd want to keep track of the "page" of the sequence in addition to the other information.

I'm guessing what's happening is that the pan is being reset whenever you go to a new page, potentially including the very first page of the sequence mode. Probably the thing to do is watch for the page event and do some handling there.

Would you be up for modifying the bookmark URL code to address this?

BTW, if I'm correct about what's causing the issue, adding preserveViewport: true to your OSD options may also fix it, though it might have unwanted side effects.

@iangilman iangilman added the bug Something isn't working label Oct 18, 2018
@kelynch
Copy link
Author

kelynch commented Oct 26, 2018

Thanks for your reply -- I'll take a stab at the code and submit a PR for review if I'm able to help. :)

@iangilman
Copy link
Member

Awesome, thank you!

@camdey
Copy link
Contributor

camdey commented Aug 20, 2021

Not sure if this was subsequently fixed but just wanted to mention it is working as expected for me in sequence mode. I also added functionality to track the page in sequence mode and maintain both zoom and pan when loading a page (without using preserveViewport).

Let me know if it's worth submitting a PR, though I can't guarantee it's the best code!

@iangilman
Copy link
Member

Interesting... I don't think there were any changes! Interesting that it's working now.

Does your new functionality have a switch that can turn it on and off? As long as it's optional, I'd love to add it in here! Pull requests are welcome, even if they aren't the best code ;)

@camdey
Copy link
Contributor

camdey commented Aug 25, 2021

@iangilman I've created a PR (#5). I made the page tracking optional but as I don't know javascript very well it may not be the best approach. Anyhow the code is working for me when used with the zoom-openseadragon WordPress plugin and latest OSD release.

@iangilman
Copy link
Member

@camdey looks solid to me! I just had a couple small refinements to suggest. Thank you for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants