moodle-mod_hvp/editor.js
thomasmars 926a665506 Remove site key field from configu UI
Bonus fix for hiding actions in certain old themes
JI-115
2017-04-11 10:57:46 +02:00

28 lines
721 B
JavaScript

(function ($) {
function getRow ($el) {
return $el.closest('.fitem');
}
function init () {
var $editor = $('.h5p-editor');
var $fileField = $('input[name="h5pfile"]');
if (H5PIntegration.hubIsEnabled) {
// TODO: This can easily break in new themes. Improve robustness of this
// by not including h5paction in form, when it should not be used.
$('input[name="h5paction"]').parents('.fitem').last().hide();
}
H5PEditor.init(
$('#mform1'),
$('input[name="h5paction"]'),
getRow($fileField),
getRow($editor),
$editor,
$('input[name="h5plibrary"]'),
$('input[name="h5pparams"]')
);
}
$(document).ready(init);
})(H5P.jQuery);