From 03720940d4e1c0825400d6bc0676596f0f5bf46b Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 26 Jan 2019 19:31:41 +0100 Subject: [PATCH] Resize embedded iframes to content height (this should fix #130) --- public/js/grocy.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 1e113f75..1c5f9a9c 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -463,7 +463,12 @@ ResizeResponsiveEmbeds = function(fillEntireViewport = false) var maxHeight = $("body").height(); } - $(".embed-responsive").attr("height", maxHeight.toString() + "px"); + $("embed.embed-responsive").attr("height", maxHeight.toString() + "px"); + + $("iframe.embed-responsive").each(function() + { + $(this).attr("height", $(this)[0].contentWindow.document.body.scrollHeight.toString() + "px"); + }); } $(window).on('resize', function() {