HFP-1407 Improve robustness of content-id retrival
The code made an assumption that the $element.parent() would contain the [data-content-id] which isn't always true. Changed the code, so that it looks up the parent with [data-content-id].pull/42/head
parent
7728243c18
commit
e3d7cf2562
|
@ -501,7 +501,8 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull
|
||||||
// We're called from an iframe.
|
// We're called from an iframe.
|
||||||
$body = H5P.jQuery(body);
|
$body = H5P.jQuery(body);
|
||||||
$classes = $body.add($element.get());
|
$classes = $body.add($element.get());
|
||||||
var iframeSelector = '#h5p-iframe-' + $element.parent().data('content-id');
|
var contentId = $element.closest('[data-content-id]').data('content-id');
|
||||||
|
var iframeSelector = '#h5p-iframe-' + contentId;
|
||||||
$iframe = H5P.jQuery(iframeSelector);
|
$iframe = H5P.jQuery(iframeSelector);
|
||||||
$element = $iframe.parent(); // Put iframe wrapper in fullscreen, not container.
|
$element = $iframe.parent(); // Put iframe wrapper in fullscreen, not container.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue