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

Dynamically Sync Viewers #122

Closed
AndreDiler opened this issue Jun 18, 2018 · 4 comments
Closed

Dynamically Sync Viewers #122

AndreDiler opened this issue Jun 18, 2018 · 4 comments

Comments

@AndreDiler
Copy link

Hello,

Although the global option "papaya.Container.syncViewers" syncs images in all viewers, is it possible to dynamically sync (based on a selection of the user) the viewers without reloading the data ?
For example, if the user has 5 viewers on the same page, can he choose to sync only 2 of them ?

If this functionality is not included, do you have an idea on how to implement this feature ?

Thank you !

Andre

@martinezmj-ims
Copy link
Contributor

I've added an ignoreSync option for the viewer. You can now dynamically do:
papayaContainers[0].viewer.ignoreSync=true; -- where papayaContainers index is the viewer instance.

Let me know if you have any issues getting it to work.

@AndreDiler
Copy link
Author

AndreDiler commented Jun 29, 2018

Thanks a lot for your commit, the functionality works perfectly.
However, I cannot change the parameter dynamically (with an onClick event for example).
<div class="papaya" data-params="params"></div>
<button onclick="myFunction()">Sync</button>
params["ignoreSync"] = true;

function myFunction() {params["ignoreSync"] = false;}

I have to change the parameter manually and reload the page to see the changes.
Do you have an idea of how to achieve this task ?

Thank you,

Andre

@martinezmj-ims
Copy link
Contributor

Dynamically, you would use this format:

papayaContainers[index].viewer.ignoreSync=true;

Where index refers to the viewer index (e.g., first=0, second=1, etc)

@AndreDiler
Copy link
Author

It works perfectly, thank you !

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