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

Add redraw() public method. #886

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

markus-drupal
Copy link

@markus-drupal markus-drupal commented May 5, 2020

This is necesssary to be able to redraw the colorbox on the current slide to force re-position or resize based on events that are not controlled by dom events. It is not possible to implement such a method from outside the colorbox plugin because it uses internal variables that cannot be accessed from the outter space...

This is necesssary to be able to redraw the colorbox on the current slide to force re-position or sixe based on events that are not controlled by dom events. It is not possible to implement such a method from outside the colorbox plugin because it uses internal variables that cannot be accessed from the outter space...
@jackmoore
Copy link
Owner

Sorry, it's been a long time since I looked at this code. Did you try calling $.colorbox.resize()? It was intended to address the situation I think you are describing, but maybe I'm missing something.

@markus-drupal
Copy link
Author

Hi Jack, thanks for checking this as fast!

I tried resize first, but it does not compute well the new size of the modal. When using the next/prev methods did it well, so I implemented this redraw() idea, which is just like next/prev on the current slide. The magic that works well to compute the new dimensions and position of the model happens in launch().

Oh and I just added a new commit to ensure the modal is not re-opened if it was closed.

Regards!
Marc

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

Successfully merging this pull request may close these issues.

None yet

2 participants