pull/40/head
thomasmars 2017-06-22 10:56:42 +02:00
commit f07ce1b3c3
2 changed files with 17 additions and 17 deletions

View File

@ -315,7 +315,7 @@ H5P.ConfirmationDialog = (function (EventDispatcher) {
if (resizeIFrame && options.instance) { if (resizeIFrame && options.instance) {
var minHeight = parseInt(popup.offsetHeight, 10) + var minHeight = parseInt(popup.offsetHeight, 10) +
exitButtonOffset + (2 * shadowOffset); exitButtonOffset + (2 * shadowOffset);
wrapperElement.style.minHeight = minHeight + 'px'; self.setViewPortMinimumHeight(minHeight);
options.instance.trigger('resize'); options.instance.trigger('resize');
resizeIFrame = false; resizeIFrame = false;
} }
@ -340,10 +340,21 @@ H5P.ConfirmationDialog = (function (EventDispatcher) {
setTimeout(function () { setTimeout(function () {
popupBackground.classList.add('hidden'); popupBackground.classList.add('hidden');
wrapperElement.removeChild(popupBackground); wrapperElement.removeChild(popupBackground);
self.setViewPortMinimumHeight(null);
}, 100); }, 100);
return this; return this;
}; };
/**
* Sets the minimum height of the view port
*
* @param {number|null} minHeight
*/
this.setViewPortMinimumHeight = function(minHeight) {
var container = document.querySelector('.h5p-container') || document.body;
container.style.minHeight = (typeof minHeight === 'number') ? (minHeight + 'px') : minHeight;
};
} }
ConfirmationDialog.prototype = Object.create(EventDispatcher.prototype); ConfirmationDialog.prototype = Object.create(EventDispatcher.prototype);

View File

@ -1017,24 +1017,13 @@ H5P.findCopyrights = function (info, parameters, contentId) {
continue; // Do not check continue; // Do not check
} }
/* /**
* TODO: Make parameters clean again * @deprecated This hack should be removed after 2017-11-01
* Some content types adds jQuery or other objects to parameters * The code that was using this was removed by HFP-574
* in order to determine override settings for sub-content-types.
* For instance Question Set tells Multiple Choice that it should
* attach Multi Choice's confirmation dialog to a Question Set
* jQuery element, so that the confirmation dialog will not be restricted
* to the space confined by Multi Choice.
* Ideally this should not be added to parameters, we must make a better
* solution. We should likely be adding these to sub-content through
* functions/setters instead of passing them down as params.
*
* This solution is implemented as a hack that will ignore all parameters
* inside a "overrideSettings" field, this should suffice for now since
* all overridden objects are added to this field, however this is not very
* robust solution and will very likely lead to problems in the future.
*/ */
if (field === 'overrideSettings') { if (field === 'overrideSettings') {
console.warn("The semantics field 'overrideSettings' is DEPRECATED and should not be used.");
console.warn(parameters);
continue; continue;
} }