Skip to content

Commit

Permalink
Merge pull request #15 from h5p/JI-2817-chase-frames-jump
Browse files Browse the repository at this point in the history
JI-2817 Fix chase frame jumps even though had enough space for confusion popup
  • Loading branch information
j0kerZ authored Oct 13, 2021
2 parents 76edc9b + 177b719 commit 99301e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/h5p.js
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,8 @@ H5P.ConfusionPopup = function($element, instance, contentId, anonymousCheckboxEn
$dialog.addClass('h5p-open'); // Fade in
const oldHeight = $element[0].getBoundingClientRect().height;
const newHeight = $dialog[0].getBoundingClientRect().height;
if (oldHeight < newHeight) {
// Verify that oldheight is enough to cover dialog then ignore height changes
if (oldHeight < newHeight && oldHeight < $dialog.height()) {
$element.css('height', newHeight+"px");
H5P.trigger(instance, 'resize');
heightChanged = true;
Expand All @@ -1663,7 +1664,7 @@ H5P.ConfusionPopup = function($element, instance, contentId, anonymousCheckboxEn
if ($dialog.hasClass("h5p-open")) {
const oldHeight = $element[0].getBoundingClientRect().height;
const newHeight = $dialog[0].getBoundingClientRect().height;
if (oldHeight < newHeight) {
if (oldHeight < newHeight && oldHeight < $dialog.height()) {
$element.css('height', newHeight+"px");
heightChanged = true;
}
Expand Down

0 comments on commit 99301e8

Please sign in to comment.