Merge pull request #13463 from MrPetovan/task/imagegrid-improvement

Rework image grid to horizontal masonry, allocate space for images to load
This commit is contained in:
Tobias Diekershoff
2023-09-24 12:59:10 +02:00
committed by GitHub
11 changed files with 149 additions and 48 deletions

View File

@@ -1169,4 +1169,15 @@ class Media
}
return $url . $id;
}
/**
* Computes the allocated height value used in the content/image.tpl template based on a post-media record
*
* @param array $media A post-media record array
* @return string
*/
public static function getAllocatedHeightByMedia(array $media): string
{
return (100 * $media['height'] / $media['width']) . '%';
}
}