mirror of
https://github.com/grocy/grocy.git
synced 2025-08-29 17:26:03 +00:00
Improve responsive embeds (references #25)
This commit is contained in:
@@ -322,3 +322,22 @@ if ($(".custom-file-label").length > 0)
|
||||
{
|
||||
$("<style>").html('.custom-file-label::after { content: "' + L("Select file") + '"; }').appendTo("head");
|
||||
}
|
||||
|
||||
ResizeResponsiveEmbeds = function(fillEntireViewport = false)
|
||||
{
|
||||
if (!fillEntireViewport)
|
||||
{
|
||||
var maxHeight = $("body").height() - $("#mainNav").outerHeight() - 62;
|
||||
}
|
||||
else
|
||||
{
|
||||
var maxHeight = $("body").height();
|
||||
}
|
||||
|
||||
$(".embed-responsive").attr("height", maxHeight.toString() + "px");
|
||||
}
|
||||
$(window).on('resize', function()
|
||||
{
|
||||
console.log($("body").hasClass("fullscreen-responsive-embed-active"));
|
||||
ResizeResponsiveEmbeds($("body").hasClass("fullscreen-responsive-embed-active"));
|
||||
});
|
||||
|
@@ -50,6 +50,7 @@ function DisplayEquipment(id)
|
||||
$("#selected-equipment-has-no-instruction-manual-hint").addClass("d-none");
|
||||
|
||||
$("a[href='#instruction-manual-tab']").tab("show");
|
||||
ResizeResponsiveEmbeds();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -118,6 +119,8 @@ $("#selectedEquipmentInstructionManualToggleFullscreenButton").on('click', funct
|
||||
$("#selectedEquipmentInstructionManualCard").toggleClass("fullscreen");
|
||||
$("#selectedEquipmentInstructionManualCard .card-header").toggleClass("fixed-top");
|
||||
$("#selectedEquipmentInstructionManualCard .card-body").toggleClass("mt-5");
|
||||
$("body").toggleClass("fullscreen-responsive-embed-active");
|
||||
ResizeResponsiveEmbeds(true);
|
||||
});
|
||||
|
||||
$("#selectedEquipmentDescriptionToggleFullscreenButton").on('click', function(e)
|
||||
|
@@ -124,5 +124,7 @@ $('#description').summernote({
|
||||
lang: L('summernote_locale')
|
||||
});
|
||||
|
||||
ResizeResponsiveEmbeds();
|
||||
|
||||
$('#name').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('equipment-form');
|
||||
|
Reference in New Issue
Block a user