diff --git a/js/h5p.js b/js/h5p.js
index df93a0c..9381c3e 100644
--- a/js/h5p.js
+++ b/js/h5p.js
@@ -88,40 +88,38 @@ H5P.init = function () {
});
}
- if (contentData.disable & H5P.DISABLE_FRAME) {
- $element.addClass('h5p-no-frame');
+ // Create action bar
+ var $actions = H5P.jQuery('
');
+
+ if (!(contentData.disable & H5P.DISABLE_DOWNLOAD)) {
+ // Add export button
+ H5P.jQuery('' + H5P.t('download') + '').appendTo($actions).click(function () {
+ window.location.href = contentData.exportUrl;
+ });
+ }
+ if (!(contentData.disable & H5P.DISABLE_COPYRIGHT) && instance.getCopyrights !== undefined) {
+ // Add copyrights button
+ H5P.jQuery('' + H5P.t('copyrights') + '').appendTo($actions).click(function () {
+ H5P.openCopyrightsDialog($actions, instance, library.params, contentId);
+ });
+ }
+ if (!(contentData.disable & H5P.DISABLE_EMBED)) {
+ // Add embed button
+ H5P.jQuery('' + H5P.t('embed') + '').appendTo($actions).click(function () {
+ H5P.openEmbedDialog($actions, contentData.embedCode);
+ });
+ }
+ if (!(contentData.disable & H5P.DISABLE_ABOUT)) {
+ // Add about H5P button icon
+ H5P.jQuery('').appendTo($actions);
+ }
+
+ // Insert action bar if it has any content
+ if ($actions.children().length) {
+ $actions.insertAfter($container);
}
else {
- // Create action bar
- var $actions = H5P.jQuery('');
-
- if (!(contentData.disable & H5P.DISABLE_DOWNLOAD)) {
- // Add export button
- H5P.jQuery('' + H5P.t('download') + '').appendTo($actions).click(function () {
- window.location.href = contentData.exportUrl;
- });
- }
- if (!(contentData.disable & H5P.DISABLE_COPYRIGHT) && instance.getCopyrights !== undefined) {
- // Add copyrights button
- H5P.jQuery('' + H5P.t('copyrights') + '').appendTo($actions).click(function () {
- H5P.openCopyrightsDialog($actions, instance, library.params, contentId);
- });
- }
- if (!(contentData.disable & H5P.DISABLE_EMBED)) {
- // Add embed button
- H5P.jQuery('' + H5P.t('embed') + '').appendTo($actions).click(function () {
- H5P.openEmbedDialog($actions, contentData.embedCode);
- });
- }
- if (!(contentData.disable & H5P.DISABLE_ABOUT)) {
- // Add about H5P button icon
- H5P.jQuery('').appendTo($actions);
- }
-
- // Insert action bar if it has any content
- if ($actions.children().length) {
- $actions.insertAfter($container);
- }
+ $element.addClass('h5p-no-frame');
}
// Keep track of when we started