Skip to content

Commit

Permalink
add button to enable fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanWin committed Mar 9, 2022
1 parent 48bbe89 commit 6e367c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion plugins/h5p-drawing-board/drawing-board.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.h5p-drawing-board {
/* border: 1px solid red; */
display: flex;
flex-direction: column;
box-sizing: border-box;
}

.h5p-drawing-board.h5p-fullscreen {
width: 100% !important;
height: 100% !important;
overflow: auto !important;
}

.h5p-drawing-board * {
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}
Expand Down
13 changes: 13 additions & 0 deletions plugins/h5p-drawing-board/drawing-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ H5P.DrawingBoard = (function (_$) {
<div class="bottom-controls-container">
<button id="clear-button-${id}" class="bottom-button">Neu</button>
<button id="save-button-${id}" class="bottom-button">Speichern</button>
<button id="fullscreen-button-${id}" class="bottom-button">Vollbild</button>
</div>
`);

Expand All @@ -325,6 +326,18 @@ H5P.DrawingBoard = (function (_$) {
clearStorage();
};

const fullscreenButton = document.getElementById(`fullscreen-button-${id}`);

fullscreenButton.onclick = () => {
if (H5P.isFullscreen) {
H5P.exitFullScreen();
fullscreenButton.innerHTML = 'Vollbildmodus';
} else {
H5P.fullScreen($container, this);
fullscreenButton.innerHTML = 'Vollbildmodus beenden';
}
};

const saveButton = document.getElementById(`save-button-${id}`);

saveButton.onclick = () => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/h5p-drawing-board/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Displays a simple drawing board",
"majorVersion": 1,
"minorVersion": 3,
"patchVersion": 3,
"patchVersion": 4,
"runnable": 1,
"author": "Stefan Wintergerst",
"license": "MIT",
Expand Down

0 comments on commit 6e367c2

Please sign in to comment.