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



Acceptance Criteria

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.


Thomas Marstrander
August 17, 2017, 8:38 AM

The selectors were a little bit off, I just fixed them.
Excellent work, everything looks good now

Timothy Lim
August 16, 2017, 1:53 PM

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

Thomas Marstrander
August 16, 2017, 1:04 PM

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.

Timothy Lim
August 16, 2017, 12:04 PM

Thanks for the review. It should be fixed now.

Thomas Marstrander
August 16, 2017, 10:36 AM

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.



Timothy Lim


Thomas Marstrander


Code reviewer

Thomas Marstrander



Time remaining


Fix versions