mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Lazy load all images to increase page load times (references #275)
This commit is contained in:
@@ -103,12 +103,13 @@ var calendar = $("#calendar").fullCalendar({
|
||||
|
||||
if (recipe.picture_file_name && !recipe.picture_file_name.isEmpty())
|
||||
{
|
||||
element.html(element.html() + '<img src="' + U("/api/files/recipepictures/") + btoa(recipe.picture_file_name) + '?force_serve_as=picture&best_fit_height=400&best_fit_width=400" class="img-fluid">')
|
||||
element.html(element.html() + '<img data-src="' + U("/api/files/recipepictures/") + btoa(recipe.picture_file_name) + '?force_serve_as=picture&best_fit_width=400" class="img-fluid lazy">')
|
||||
}
|
||||
},
|
||||
"eventAfterAllRender": function(view)
|
||||
{
|
||||
RefreshLocaleNumberDisplay();
|
||||
LoadImagesLazy();
|
||||
|
||||
if (GetUriParam("week") !== undefined)
|
||||
{
|
||||
|
Reference in New Issue
Block a user