IV image does not resize after opened in mobile view
Steps to reproduce:
1) Create IV
2) Create image as poster
3) Enable "Turn into button on small screens"
4) Save IV
5) Go to image timecode
6) Make IV into mobile view
7) Click image button
8) Exit image
9) Make IV into desktop view
10) Resize window and observe that image is now not expanding to fit the initial poster size
1) Image as poster must be able to resume its original resizing as poster features after having been turned into a button and opened in mobile view.
The selectors were a little bit off, I just fixed them.
Excellent work, everything looks good now
I've tried to make it more specific by only selecting if the sibling class is h5p-image. Let me know if I'm jquery-ing wrong...
Excellent, everything is working well now!
I still have 1 concern though. Your selector for "img" tags will hit all images within the dialog's content when closing. This means that a "Drag Question" interaction will have all its <img> tag dimensions reset when you close a dialog with DQ in it. I think this can have very unfortunate side-effects. You can combat this by making the selector more specific, e.g. by targeting only dialogs with the ".h5p-image" class. Similarly targeting all ".h5p-dialog" classes in Interactive Video seems a bit unspecific and error-prone when closing the dialog instantly.
Thanks for the review. It should be fixed now.
Much better, still one thing remaining:
1) When closing the dialog instantly, the transitionend will never fire, because the element is removed before the transition ends. Thus when you are closing the dialog instantly, you must also set reset the image dimensions. If you now go to mobile view, then open the dialog and resize the window out of mobile view the image as a poster will have a fixed image size.