Skip to content

Commit f5288f1

Browse files
authored
VA-523 mmc review fixes (#79)
* VA-523 reset padding on buttons * VA-523 handle undefined options
1 parent 7ff3d3a commit f5288f1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/scripts/h5p-multi-media-choice.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ export default class MultiMediaChoice extends H5P.Question {
2424
this.params = Util.extendParams(params);
2525

2626
// Override subcontent params
27-
for (const option of this.params.options) {
28-
if (option.media?.library?.includes('H5P.Audio')) {
29-
option.media.params.fitToWrapper = false; // VA-523: prevent warped button
27+
if (Array.isArray(this.params?.options)) {
28+
for (const option of this.params.options) {
29+
if (option.media?.library?.includes('H5P.Audio')) {
30+
option.media.params.fitToWrapper = false; // VA-523: prevent warped button
31+
}
3032
}
3133
}
3234

src/styles/h5p-multi-media-choice.scss

+2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
bottom: 0;
168168
right: 0;
169169
margin: 0.5em;
170+
padding: 0;
170171
width: $button-size;
171172
height: $button-size;
172173
display: flex;
@@ -252,6 +253,7 @@
252253
display: flex;
253254
justify-content: center;
254255
align-items: center;
256+
padding: 0;
255257

256258
@container h5p-mmc-modal-container (width < 480px) {
257259
right: 0;

0 commit comments

Comments
 (0)