Improvements for display #1

Merged
norbert.tretkowski merged 11 commits from max.lissowski/mastowall:for-pi2 into for-pi2 2023-11-24 07:53:19 +01:00
Showing only changes of commit 8cdc4ea5c3 - Show all commits

View file

@ -132,8 +132,6 @@ const displayPost = function(post) {
const processPosts = function(posts) { const processPosts = function(posts) {
posts = posts.filter((post) => secondsAgo(new Date(post.created_at)) < maxAge); posts = posts.filter((post) => secondsAgo(new Date(post.created_at)) < maxAge);
posts.sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
return posts; return posts;
}; };
@ -143,6 +141,8 @@ const updateWall = function(posts) {
posts = processPosts(posts); posts = processPosts(posts);
posts.sort((a, b) => new Date(a.created_at) - new Date(b.created_at));
let ret = 0 let ret = 0
posts.forEach(post => ret += displayPost(post)); posts.forEach(post => ret += displayPost(post));
$('.masonry-grid').masonry('layout'); $('.masonry-grid').masonry('layout');
@ -156,6 +156,8 @@ const updateCarousel = function(slides, posts) {
posts = processPosts(posts); posts = processPosts(posts);
posts.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
// remove slides in carousel // remove slides in carousel
slides.innerHTML = ""; slides.innerHTML = "";
var newHTML = ` <!-- No Indicators -->` var newHTML = ` <!-- No Indicators -->`