diff --git a/public/js/grocy.js b/public/js/grocy.js
index 41567e42..bbc21578 100644
--- a/public/js/grocy.js
+++ b/public/js/grocy.js
@@ -542,7 +542,16 @@ ResizeResponsiveEmbeds = function()
{
$("iframe.embed-responsive").each(function()
{
- $(this).attr("height", $(this)[0].contentWindow.document.body.scrollHeight.toString() + "px");
+ var iframeBody = $(this)[0].contentWindow.document.body;
+ if (iframeBody)
+ {
+ $(this).attr("height", iframeBody.scrollHeight.toString() + "px");
+ }
+
+ if ($("body").hasClass("fullscreen-card"))
+ {
+ $(this).attr("height", $("body").height().toString() + "px");
+ }
});
var maxHeight = $("body").height() - $("#mainNav").outerHeight() - 62;
@@ -550,7 +559,7 @@ ResizeResponsiveEmbeds = function()
{
maxHeight = $("body").height();
}
- $("embed.embed-responsive").attr("height", maxHeight.toString() + "px");
+ $("embed.embed-responsive:not(.resize-done)").attr("height", maxHeight.toString() + "px").addClass("resize-done");
}
$(window).on("resize", function()
{
@@ -564,6 +573,10 @@ $(document).on("shown.bs.modal", function(e)
{
ResizeResponsiveEmbeds();
});
+$(document).on("hidden.bs.modal", function(e)
+{
+ $("body").removeClass("fullscreen-card");
+});
$("body").children().each(function(index, child)
{
new ResizeObserver(function()
@@ -705,8 +718,8 @@ if (Grocy.CalendarFirstDayOfWeek)
if (GetUriParam("embedded"))
{
- $("body").append('
\
-