mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
21 lines
495 B
JavaScript
21 lines
495 B
JavaScript
function ResizeResponsiveEmbeds(fillEntireViewport = false)
|
|
{
|
|
var maxHeight = null;
|
|
if (!fillEntireViewport)
|
|
{
|
|
maxHeight = $("body").height() - $("#mainNav").outerHeight() - 62;
|
|
}
|
|
else
|
|
{
|
|
maxHeight = $("body").height();
|
|
}
|
|
|
|
$("embed.embed-responsive").attr("height", maxHeight.toString() + "px");
|
|
|
|
$("iframe.embed-responsive").each(function()
|
|
{
|
|
$(this).attr("height", $(this)[0].contentWindow.document.body.scrollHeight.toString() + "px");
|
|
});
|
|
}
|
|
|
|
export { ResizeResponsiveEmbeds } |