forked from h5p/h5p-advanced-blanks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrades.js
38 lines (33 loc) · 1.06 KB
/
upgrades.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var H5PUpgrades = H5PUpgrades || {};
H5PUpgrades['H5P.AdvancedBlanks'] = (function () {
return {
/**
* Move disableImageZooming from behaviour to media
*
* @param {object} parameters Parameters
* @param {function} finished Callback.
* @param {object} extras Extras.
*/
1: {
1: {
contentUpgrade: function (parameters, finished, extras) {
// Overly cautious here like H5P core team
if (parameters) {
const newMedia = {
// Copy old disableImageZooming or set default
disableImageZooming: parameters.behaviour && parameters.behaviour.disableImageZooming || false,
};
// Remove old disableImageZooming
delete parameters.behaviour.disableImageZooming;
if (parameters.media) {
// Copy old media instance parameters
newMedia.type = parameters.media
};
parameters.media = newMedia
}
finished(null, parameters, extras);
}
}
}
};
})();