waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
449 stars 70 forks source link

Feature Request: Resort Order #17

Closed cnelson-pdx closed 2 years ago

cnelson-pdx commented 2 years ago

Not finding a way to change the sort order from newest to oldest to oldest to newest.

Would be cool to see this either as an on the fly button in the webUI or something set in the config prior to thumbnail creation.

If I'm just missing something, my apologies.

waschinski commented 2 years ago

Thanks for suggesting this feature. Actually both ideas (pre-configuration and on-the-fly change) sound reasonable.

I quickly played around with some JavaScript for the on-the-fly change and it seems to work fine even with the lazy loading going on.

If you want to see how that could work, open your developer tools in your browser (F12) and paste this code to your console:

function reverseSorting() {
    var parent = document.getElementById('target');
    for (var i = 1; i < parent.childNodes.length; i++){
        parent.insertBefore(parent.childNodes[i], parent.firstChild);
    }
}

Then calling reverseSorting(); should change the sorting on the page.

waschinski commented 2 years ago

Check out the latest update. ;)

Docker images should also be updated soon.