Skip to content

Commit

Permalink
Merge pull request #161 from NDLANO/fix-fullscreen-as-subcontent
Browse files Browse the repository at this point in the history
Fix fullscreen when being used as subcontent
  • Loading branch information
otacke authored Jul 11, 2024
2 parents 30eadb8 + 83e91a2 commit aa6d7ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ export default class Wrapper extends H5P.EventDispatcher {
resize() {
const rect = this.getRect();
// Fullscreen should use all of the space
const ratio = (H5P.isFullscreen ? (rect.height / rect.width) : (9 / 16));
const isStandaloneFullscreen = H5P.isFullscreen && this.isRoot();

this.wrapper.style.height = H5P.isFullscreen ?
const ratio = isStandaloneFullscreen ?
(rect.height / rect.width) :
(9 / 16);

this.wrapper.style.height = isStandaloneFullscreen ?
'100%' :
`${rect.width * ratio}px`;

Expand Down

0 comments on commit aa6d7ed

Please sign in to comment.