Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 99301e8

Browse files
authoredOct 13, 2021
Merge pull request #15 from h5p/JI-2817-chase-frames-jump
JI-2817 Fix chase frame jumps even though had enough space for confusion popup
2 parents 76edc9b + 177b719 commit 99301e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎js/h5p.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,8 @@ H5P.ConfusionPopup = function($element, instance, contentId, anonymousCheckboxEn
16401640
$dialog.addClass('h5p-open'); // Fade in
16411641
const oldHeight = $element[0].getBoundingClientRect().height;
16421642
const newHeight = $dialog[0].getBoundingClientRect().height;
1643-
if (oldHeight < newHeight) {
1643+
// Verify that oldheight is enough to cover dialog then ignore height changes
1644+
if (oldHeight < newHeight && oldHeight < $dialog.height()) {
16441645
$element.css('height', newHeight+"px");
16451646
H5P.trigger(instance, 'resize');
16461647
heightChanged = true;
@@ -1663,7 +1664,7 @@ H5P.ConfusionPopup = function($element, instance, contentId, anonymousCheckboxEn
16631664
if ($dialog.hasClass("h5p-open")) {
16641665
const oldHeight = $element[0].getBoundingClientRect().height;
16651666
const newHeight = $dialog[0].getBoundingClientRect().height;
1666-
if (oldHeight < newHeight) {
1667+
if (oldHeight < newHeight && oldHeight < $dialog.height()) {
16671668
$element.css('height', newHeight+"px");
16681669
heightChanged = true;
16691670
}

0 commit comments

Comments
 (0)
Please sign in to comment.