Make sure focus is set after timeout, to not skewer content.

HFJ-1867
pull/23/head
Thomas Marstrander 2016-05-04 12:37:59 +02:00
parent 7782b19e99
commit e412c3a228
1 changed files with 7 additions and 8 deletions

View File

@ -188,20 +188,19 @@ H5P.ConfirmationDialog = (function (EventDispatcher) {
popup.classList.remove('hidden');
popupBackground.classList.remove('hiding');
setTimeout(function () {
// Focus confirm button
confirmButton.focus();
// Resize iFrame if necessary
if (resizeIFrame && options.instance) {
setTimeout(function () {
var minHeight = parseInt(popup.offsetHeight, 10) +
exitButtonOffset + (2 * shadowOffset);
wrapperElement.style.minHeight = minHeight + 'px';
options.instance.trigger('resize');
resizeIFrame = false;
}, 100);
}
}, 100);
}, 0);
return this;