From 1341768c90ae243e1dfef8cba31d9ee04656abc1 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 20 Dec 2016 14:37:31 +0100 Subject: [PATCH] Fixed problem with empty actionbar [HFP-277] --- js/h5p.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index a080ebf..aa313b1 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -133,6 +133,7 @@ H5P.init = function (target) { * Create action bar */ var displayOptions = contentData.displayOptions; + var displayFrame = false; if (displayOptions.frame) { // Special handling of copyrights if (displayOptions.copyright) { @@ -160,15 +161,13 @@ H5P.init = function (target) { }); }); - $actions.insertAfter($container); + if (actionBar.hasActions()) { + displayFrame = true; + $actions.insertAfter($container); + } } - if (displayOptions.frame && actionBar.hasActions()) { - $element.addClass('h5p-frame'); - } - else { - $element.addClass('h5p-no-frame'); - } + $element.addClass(displayFrame ? 'h5p-frame' : 'h5p-no-frame'); // Keep track of when we started H5P.opened[contentId] = new Date();