From 24cac247f560eef52dc97ebd02ec74ec5771ec43 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 24 Feb 2024 20:13:39 +0100 Subject: [PATCH] Don't resize invisible embedded iframes (references #2480 and #2421) --- public/js/grocy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/js/grocy.js b/public/js/grocy.js index cf8fa925..fe64b9c5 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -560,6 +560,11 @@ ResizeIframes = function() { $("iframe.embed-responsive").each(function() { + if (!$(this).isVisibleInViewport()) + { + return; + } + var desiredHeight = $(this)[0].contentWindow.document.body.scrollHeight; if (desiredHeight == 0) {