Hugrid (Hugo+grid) is a simple grid theme for Hugo. It's a kind of boilerplate to perform anyone or anything quickly. Portfolio, collection, bookmarks, contacts and so on.
I'm trying to add the ability to sort the thumbnails. After sorting them I had to change their offset for the preview to show in the correct location. However when I close the preview now, the expanded tag and styling doesn't hide like it normally does. What else needs to be changed?
$("#sort").on("click",function(){
$(".og-grid li").sort(sort_li) // sort elements
.appendTo('.og-grid'); // append again to the list
//reset where preview shows from
$('li').each(function(i,obj){
$(obj).data( {
offsetTop : $(obj).offset().top,
height : $(obj).height()
} );
})
function sort_li(a, b){
return ($(b).data('hero')) > ($(a).data('hero')) ? 1 : -1;
}
})
I'm trying to add the ability to sort the thumbnails. After sorting them I had to change their offset for the preview to show in the correct location. However when I close the preview now, the expanded tag and styling doesn't hide like it normally does. What else needs to be changed?