colorbox icon indicating copy to clipboard operation
colorbox copied to clipboard

Add redraw() public method.

Open markus-drupal opened this issue 5 years ago • 2 comments

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...

markus-drupal avatar May 05 '20 22:05 markus-drupal

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.

jackmoore avatar May 05 '20 23:05 jackmoore

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

markus-drupal avatar May 05 '20 23:05 markus-drupal